Fix crash during RPak load

* Added missing parameter to 'PakLoadFuncs_s::WaitAsync'.
* Fix offset to 'g_pakLoadApi'.
This commit is contained in:
Kawe Mazidjatari 2023-09-09 20:57:00 +02:00
parent 6215fd5dc6
commit 3fd898bf30
2 changed files with 3 additions and 3 deletions

View File

@ -23,7 +23,7 @@ InitReturnVal_t CMaterialSystem::Init(CMaterialSystem* thisptr)
// Only load the 'startup.rpak' file, as 'common_early.rpak' has assets
// that references assets in 'startup.rpak'.
RPakHandle_t pakHandle = g_pakLoadApi->LoadAsync("startup.rpak", AlignedMemAlloc(), 5, 0);
g_pakLoadApi->WaitAsync(pakHandle);
g_pakLoadApi->WaitAsync(pakHandle, nullptr);
// Trick: return INIT_FAILED to disable the loading of hardware
// configuration data, since we don't need it on the dedi.

View File

@ -32,7 +32,7 @@ typedef struct PakLoadFuncs_s
char unknown2[16];
void* Func7;
void* Func8;
RPakStatus_t(*WaitAsync)(RPakHandle_t handle);
RPakStatus_t(*WaitAsync)(RPakHandle_t handle, void* pFinishCallback);
void* Func10;
void* Func11;
void* FindByGUID;
@ -92,7 +92,7 @@ class V_RTechGame : public IDetour
}
virtual void GetVar(void) const
{
g_pakLoadApi = p_LauncherMain.Offset(0x800).FindPatternSelf("48 8D").ResolveRelativeAddressSelf(0x3, 0x7).RCast<PakLoadFuncs_t*>();
g_pakLoadApi = p_LauncherMain.Offset(0x820).FindPatternSelf("48 89").ResolveRelativeAddressSelf(0x3, 0x7).RCast<PakLoadFuncs_t*>();
}
virtual void GetCon(void) const
{