More Fixes

This commit is contained in:
TheBrokenRail 2024-02-01 14:55:27 -05:00
parent 5730267135
commit 95e24d13fa
2 changed files with 6 additions and 5 deletions

View File

@ -123,7 +123,8 @@ export function load(target: Struct, name: string, isExtended: boolean) {
}
case 'vtable': {
// Set VTable Address
if (!isExtended) {
target.ensureVTable();
if (!isExtended && args.length > 0) {
target.setVTableAddress(safeParseInt(args));
}
break;

View File

@ -32,7 +32,7 @@ export class Struct {
}
// Ensure VTable Exists
#ensureVTable() {
ensureVTable() {
if (this.#vtable === null) {
this.#vtable = new VTable(this.#name);
this.addProperty(this.#vtable);
@ -97,7 +97,7 @@ export class Struct {
throw new Error();
}
if (isVirtual) {
this.#ensureVTable();
this.ensureVTable();
this.#vtable!.add(method);
} else {
this.#methods.push(method);
@ -119,11 +119,11 @@ export class Struct {
// Configure VTable
setVTableSize(size: number, isExact: boolean) {
this.#ensureVTable();
this.ensureVTable();
this.#vtable!.setSize(size, isExact);
}
setVTableAddress(address: number) {
this.#ensureVTable();
this.ensureVTable();
this.#vtable!.setAddress(address);
}