diff options
author | Filip Gawin <filip.gawin@zoho.com> | 2019-06-30 22:48:33 +0200 |
---|---|---|
committer | Filip Gawin <filip.gawin@zoho.com> | 2019-07-04 01:02:00 +0200 |
commit | 9df4bc202970f5b9025adc088132f9605e7a612c (patch) | |
tree | 7209fc622d6ade684b0981807a660105b37825a8 /src | |
parent | DestroyEntity (diff) | |
download | re3-9df4bc202970f5b9025adc088132f9605e7a612c.tar re3-9df4bc202970f5b9025adc088132f9605e7a612c.tar.gz re3-9df4bc202970f5b9025adc088132f9605e7a612c.tar.bz2 re3-9df4bc202970f5b9025adc088132f9605e7a612c.tar.lz re3-9df4bc202970f5b9025adc088132f9605e7a612c.tar.xz re3-9df4bc202970f5b9025adc088132f9605e7a612c.tar.zst re3-9df4bc202970f5b9025adc088132f9605e7a612c.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/audio/AudioManager.cpp | 34 | ||||
-rw-r--r-- | src/audio/AudioManager.h | 1 |
2 files changed, 35 insertions, 0 deletions
diff --git a/src/audio/AudioManager.cpp b/src/audio/AudioManager.cpp index 0a87d0e9..45ac73c1 100644 --- a/src/audio/AudioManager.cpp +++ b/src/audio/AudioManager.cpp @@ -10,6 +10,39 @@ cAudioManager &AudioManager = *(cAudioManager *)0x880FC0; void +cAudioManager::PreTerminateGameSpecificShutdown() +{ + if(m_nBridgeEntity >= 0) { + DestroyEntity(m_nBridgeEntity); + m_nBridgeEntity = -5; + } + if(m_nPoliceChannelEntity >= 0) { + DestroyEntity(m_nPoliceChannelEntity); + m_nPoliceChannelEntity = -5; + } + if(m_nWaterCannonEntity >= 0) { + DestroyEntity(m_nWaterCannonEntity); + m_nWaterCannonEntity = -5; + } + if(m_nFireAudioEntity >= 0) { + DestroyEntity(m_nFireAudioEntity); + m_nFireAudioEntity = -5; + } + if(m_nCollisionEntity >= 0) { + DestroyEntity(m_nCollisionEntity); + m_nCollisionEntity = -5; + } + if(m_nFrontEndEntity >= 0) { + DestroyEntity(m_nFrontEndEntity); + m_nFrontEndEntity = -5; + } + if(m_nProjectileEntity >= 0) { + DestroyEntity(m_nProjectileEntity); + m_nProjectileEntity = -5; + } +} + +void cAudioManager::DestroyEntity(int32 id) { if(m_bIsInitialised && id >= 0 && id < 200 && m_asAudioEntities[id].m_bIsUsed) { @@ -2723,6 +2756,7 @@ cAudioManager::Service() } STARTPATCHES +InjectHook(0x569570, &cAudioManager::PreTerminateGameSpecificShutdown, PATCH_JUMP); InjectHook(0x57A400, &cAudioManager::DestroyEntity, PATCH_JUMP); InjectHook(0x569640, &cAudioManager::PostTerminateGameSpecificShutdown, PATCH_JUMP); InjectHook(0x57AA00, &cAudioManager::SetDynamicAcousticModelingStatus, PATCH_JUMP); diff --git a/src/audio/AudioManager.h b/src/audio/AudioManager.h index f270ada6..8d01e1eb 100644 --- a/src/audio/AudioManager.h +++ b/src/audio/AudioManager.h @@ -216,6 +216,7 @@ public: char field_19195; int m_nTimeOfRecentCrime; + void PreTerminateGameSpecificShutdown(); void DestroyEntity(int32 id); void PostTerminateGameSpecificShutdown(); bool IsAudioInitialised() const; |