diff --git a/SilentPatchSA/SilentPatchSA.cpp b/SilentPatchSA/SilentPatchSA.cpp index 51ce84a..0c10eca 100644 --- a/SilentPatchSA/SilentPatchSA.cpp +++ b/SilentPatchSA/SilentPatchSA.cpp @@ -702,6 +702,15 @@ void NewFrameRender(int nEvent, void* pParam) RsEventHandler(nEvent, pParam); } +#include +#include + +unsigned int UnsignedIntRand() +{ + static std::ranlux48 generator (time(nullptr)); + return generator() & 0x7FFFFFFF; +} + #include static void* pNVCShader = nullptr; @@ -2343,6 +2352,10 @@ void Patch_SA_10() //Patch(0x5D7265, 0xEB); + // Proper randomizations + InjectHook(0x44E82E, UnsignedIntRand); // Missing ped paths + InjectHook(0x44ECEE, UnsignedIntRand); // Missing ped paths + // Heli rotors InjectHook(0x6CAB70, &CPlane::Render_Stub, PATCH_JUMP);