diff --git a/r5dev/squirrel/sqapi.cpp b/r5dev/squirrel/sqapi.cpp index 7b557a49..7f845125 100644 --- a/r5dev/squirrel/sqapi.cpp +++ b/r5dev/squirrel/sqapi.cpp @@ -11,17 +11,13 @@ //--------------------------------------------------------------------------------- SQChar* sq_getstring(HSQUIRRELVM v, SQInteger i) { - std::uintptr_t thisptr = reinterpret_cast(v); - - return *(char**)(*(std::int64_t*)(thisptr + 0x58) + 0x10 * i + 0x8) + 0x40; + return *(char**)(*(std::int64_t*)(v->_stackbase) + 0x10 * i + 0x8) + 0x40; } //--------------------------------------------------------------------------------- SQInteger sq_getinteger(HSQUIRRELVM v, SQInteger i) { - std::uintptr_t thisptr = reinterpret_cast(v); - - return *(SQInteger*)(*(std::int64_t*)(thisptr + 0x58) + 0x10 * i + 0x8); + return *(SQInteger*)(*(std::int64_t*)(v->_stackbase) + 0x10 * i + 0x8); } //--------------------------------------------------------------------------------- diff --git a/r5dev/squirrel/sqvm.h b/r5dev/squirrel/sqvm.h index 29bd139f..da7b4297 100644 --- a/r5dev/squirrel/sqvm.h +++ b/r5dev/squirrel/sqvm.h @@ -23,8 +23,8 @@ struct SQVM #if !defined (GAMEDLL_S0) && !defined (GAMEDLL_S1) && !defined (GAMEDLL_S2) SQCONTEXT _contextidx; _BYTE gap001[8]; -#endif _BYTE gap002[4]; +#endif void* _ncvftable; void* _table; _BYTE gap003[14];