diff --git a/src/exec/misc.asm b/src/exec/misc.asm index a66917d..a45977d 100644 --- a/src/exec/misc.asm +++ b/src/exec/misc.asm @@ -5,9 +5,15 @@ setVobToTransient: resetStackoffset 0x68 pusha - mov ecx, [esi] - cmp ecx, oCNpc__vftable - jnz .back + mov eax, [esi] + mov ecx, esi + call DWORD [eax] + push eax + push oCNpc__classDef + call zCObject__CheckInheritance + add esp, 0x8 + test eax, eax + jz .back mov eax, [esi+g1g2(0x7B0,0x770)] ; oCNpc.instanz test eax, eax @@ -478,9 +484,19 @@ fix_Hlp_GetNpc: mov eax, [esi+zCPar_Symbol_offset_offset] test eax, eax jz g1g2(0x65880E,0x6EEE6E) - mov eax, [eax] - cmp eax, oCNpc__vftable - jnz g1g2(0x65880E,0x6EEE6E) + + push ecx + mov ecx, eax + mov eax, [ecx] + call DWORD [eax] + push eax + push oCNpc__classDef + call zCObject__CheckInheritance + add esp, 0x8 + test eax, eax + pop ecx + jz g1g2(0x65880E,0x6EEE6E) + verifyStackoffset 0x10 ; Jump back push edi @@ -493,11 +509,18 @@ fix_Hlp_IsValidNpc: resetStackoffset 0x18 test eax, eax jz .back - mov eax, [eax] - cmp eax, oCNpc__vftable - jz .back - xor eax, eax - jmp .backClean + + push ecx + mov ecx, eax + mov eax, [ecx] + call DWORD [eax] + push eax + push oCNpc__classDef + call zCObject__CheckInheritance + add esp, 0x8 + test eax, eax + pop ecx + jz .backClean verifyStackoffset 0x18 .back: @@ -512,11 +535,18 @@ fix_Hlp_IsValidItem: resetStackoffset 0x18 test eax, eax jz .back - mov eax, [eax] - cmp eax, oCItem__vftable - jz .back - xor eax, eax - jmp .backClean + + push ecx + mov ecx, eax + mov eax, [ecx] + call DWORD [eax] + push eax + push oCItem__classDef + call zCObject__CheckInheritance + add esp, 0x8 + test eax, eax + pop ecx + jz .backClean verifyStackoffset 0x18 .back: diff --git a/src/inc/engine_g1.inc b/src/inc/engine_g1.inc index 4f80f7d..12e67c1 100644 --- a/src/inc/engine_g1.inc +++ b/src/inc/engine_g1.inc @@ -81,8 +81,7 @@ %define oCGame__GetInfoManager 0x638AE0 ; void %define oCMissionManager_misMan 0x8DAB2C ; oCMissionManager* %define oCNpc__classDef 0x8DB408 ; zCClassDef - %define oCNpc__vftable 0x7DDF34 ; const - %define oCItem__vftable 0x7DD0CC ; const + %define oCItem__classDef 0x8DAA80 ; zCClassDef %define zCObject__CheckInheritance 0x470130 ; zCClassDef const *, zCClassDef const * %define oCWorld__InsertInLists 0x6D7670 ; zCVob * %define oCWorld__RemoveFromLists 0x6D7750 ; zCVob * diff --git a/src/inc/engine_g2.inc b/src/inc/engine_g2.inc index 3a5ef42..046d0ce 100644 --- a/src/inc/engine_g2.inc +++ b/src/inc/engine_g2.inc @@ -81,8 +81,7 @@ %define oCGame__GetInfoManager 0x6C2C90 ; void %define oCMissionManager_misMan 0xAB1384 ; oCMissionManager* %define oCNpc__classDef 0xAB1E20 ; zCClassDef - %define oCNpc__vftable 0x83D724 ; const - %define oCItem__vftable 0x83C804 ; const + %define oCItem__classDef 0xAB1168 ; zCClassDef %define zCObject__CheckInheritance 0x476E30 ; zCClassDef const *, zCClassDef const * %define oCWorld__InsertInLists 0x7808B0 ; zCVob * %define oCWorld__RemoveFromLists 0x780990 ; zCVob *