File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -843,6 +843,7 @@ void hook_CPhysicsEnvironment_DestroyObject(GMODSDK::CPhysicsEnvironment* pEnvir
843843 return ;
844844 }
845845
846+ #if ARCHITECTURE_X86
846847 pEnv->m_objects .FastRemove (foundIndex);
847848
848849 UnregisterPhysicsObject (pLuaEnvironment, pObject);
@@ -866,6 +867,11 @@ void hook_CPhysicsEnvironment_DestroyObject(GMODSDK::CPhysicsEnvironment* pEnvir
866867 pEnv->m_pSleepEvents ->DeleteObject (pPhysics);
867868 delete pObject;
868869 }
870+ #else // Required since 64x uses a different vphysics build and we don't want to corrupt member variables of the CPhysicsEnvironment
871+ detour_CPhysicsEnvironment_DestroyObject.GetTrampoline <Symbols::CPhysicsEnvironment_DestroyObject>()(pEnv, pObject);
872+
873+ UnregisterPhysicsObject (pLuaEnvironment, pObject);
874+ #endif
869875}
870876
871877static Detouring::Hook detour_CPhysicsEnvironment_Restore;
You can’t perform that action at this time.
0 commit comments