31-bit randomizer for fixing missing ped paths

This commit is contained in:
Silent 2015-09-14 01:00:39 +02:00
parent 3b98e5abaf
commit c9e900fc87

View File

@ -702,6 +702,15 @@ void NewFrameRender(int nEvent, void* pParam)
RsEventHandler(nEvent, pParam);
}
#include <ctime>
#include <random>
unsigned int UnsignedIntRand()
{
static std::ranlux48 generator (time(nullptr));
return generator() & 0x7FFFFFFF;
}
#include <xnamath.h>
static void* pNVCShader = nullptr;
@ -2343,6 +2352,10 @@ void Patch_SA_10()
//Patch<BYTE>(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);