mirror of
https://github.com/GTAmodding/re3.git
synced 2024-11-15 14:39:03 +00:00
RandomDisplacement
This commit is contained in:
parent
0ec77e8329
commit
d6957aaa57
2 changed files with 21 additions and 0 deletions
|
@ -12,6 +12,24 @@ cAudioManager &AudioManager = *(cAudioManager *)0x880FC0;
|
||||||
|
|
||||||
constexpr int totalAudioEntitiesSlots = 200;
|
constexpr int totalAudioEntitiesSlots = 200;
|
||||||
|
|
||||||
|
int32
|
||||||
|
cAudioManager::RandomDisplacement(uint32 seed)
|
||||||
|
{
|
||||||
|
int32 value;
|
||||||
|
|
||||||
|
static bool bIsEven = true;
|
||||||
|
static uint8 base = 0;
|
||||||
|
|
||||||
|
if(!seed) return 0;
|
||||||
|
|
||||||
|
value = m_anRandomTable[(base + seed) % 5] % seed;
|
||||||
|
base += value;
|
||||||
|
|
||||||
|
if(value % 2) { bIsEven = !bIsEven; }
|
||||||
|
if(!bIsEven) value = -value;
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cAudioManager::ReleaseDigitalHandle()
|
cAudioManager::ReleaseDigitalHandle()
|
||||||
{
|
{
|
||||||
|
@ -2814,6 +2832,7 @@ cAudioManager::Service()
|
||||||
}
|
}
|
||||||
|
|
||||||
STARTPATCHES
|
STARTPATCHES
|
||||||
|
InjectHook(0x57AF90, &cAudioManager::RandomDisplacement, PATCH_JUMP);
|
||||||
|
|
||||||
InjectHook(0x57A9E0, &cAudioManager::ReleaseDigitalHandle, PATCH_JUMP);
|
InjectHook(0x57A9E0, &cAudioManager::ReleaseDigitalHandle, PATCH_JUMP);
|
||||||
InjectHook(0x57A9F0, &cAudioManager::RequireDigitalHandle, PATCH_JUMP);
|
InjectHook(0x57A9F0, &cAudioManager::RequireDigitalHandle, PATCH_JUMP);
|
||||||
|
|
|
@ -216,6 +216,8 @@ public:
|
||||||
char field_19195;
|
char field_19195;
|
||||||
int m_nTimeOfRecentCrime;
|
int m_nTimeOfRecentCrime;
|
||||||
|
|
||||||
|
int32 RandomDisplacement(uint32 seed);
|
||||||
|
|
||||||
void ReleaseDigitalHandle();
|
void ReleaseDigitalHandle();
|
||||||
void RequireDigitalHandle();
|
void RequireDigitalHandle();
|
||||||
void SetDynamicAcousticModelingStatus(bool status);
|
void SetDynamicAcousticModelingStatus(bool status);
|
||||||
|
|
Loading…
Reference in a new issue