diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2020-01-01 00:42:00 +0100 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2020-01-01 00:42:00 +0100 |
commit | 5b0cf80a76e49cee88e796bb8c4b53fd3ca8f3c5 (patch) | |
tree | 2e2bca559ef34473733d63a022c74a711c894830 /src/core/Fire.cpp | |
parent | some not fully tested stuff (diff) | |
parent | making particleobject compile on vs2015 (diff) | |
download | re3-5b0cf80a76e49cee88e796bb8c4b53fd3ca8f3c5.tar re3-5b0cf80a76e49cee88e796bb8c4b53fd3ca8f3c5.tar.gz re3-5b0cf80a76e49cee88e796bb8c4b53fd3ca8f3c5.tar.bz2 re3-5b0cf80a76e49cee88e796bb8c4b53fd3ca8f3c5.tar.lz re3-5b0cf80a76e49cee88e796bb8c4b53fd3ca8f3c5.tar.xz re3-5b0cf80a76e49cee88e796bb8c4b53fd3ca8f3c5.tar.zst re3-5b0cf80a76e49cee88e796bb8c4b53fd3ca8f3c5.zip |
Diffstat (limited to 'src/core/Fire.cpp')
-rw-r--r-- | src/core/Fire.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/core/Fire.cpp b/src/core/Fire.cpp index 274c06a5..5c777eab 100644 --- a/src/core/Fire.cpp +++ b/src/core/Fire.cpp @@ -5,6 +5,9 @@ CFireManager &gFireManager = *(CFireManager*)0x8F31D0; WRAPPER void CFire::Extinguish(void) { EAXJMP(0x479D40); } +WRAPPER void CFireManager::StartFire(CEntity* entityOnFire, CEntity* culprit, float, uint32) { EAXJMP(0x479590); } +WRAPPER void CFireManager::Update(void) { EAXJMP(0x479310); } +WRAPPER CFire* CFireManager::FindFurthestFire_NeverMindFireMen(CVector coors, float, float) { EAXJMP(0x479430); } uint32 CFireManager::GetTotalActiveFires() const { @@ -38,12 +41,28 @@ CFire* CFireManager::FindNearestFire(CVector vecPos, float* pDistance) return nil; } +void +CFireManager::ExtinguishPoint(CVector point, float range) +{ + for (int i = 0; i < NUM_FIRES; i++) { + if (m_aFires[i].m_bIsOngoing) { + if ((point - m_aFires[i].m_vecPos).MagnitudeSqr() < sq(range)) + m_aFires[i].Extinguish(); + } + } +} + WRAPPER CFire *CFireManager::FindFurthestFire_NeverMindFireMen(CVector coors, float, float) { EAXJMP(0x479430); } WRAPPER void CFireManager::StartFire(CEntity *entityOnFire, CEntity *culprit, float, uint32) { EAXJMP(0x479590); } WRAPPER void CFireManager::StartFire(CVector, float, uint8) { EAXJMP(0x479500); } -WRAPPER void CFireManager::ExtinguishPoint(CVector, float) { EAXJMP(0x479DB0); } WRAPPER int32 CFireManager::StartScriptFire(const CVector& pos, CEntity* culprit, float, uint8) { EAXJMP(0x479E60); } WRAPPER bool CFireManager::IsScriptFireExtinguish(int16) { EAXJMP(0x479FC0); } WRAPPER void CFireManager::RemoveScriptFire(int16) { EAXJMP(0x479FE0); } WRAPPER void CFireManager::RemoveAllScriptFires(void) { EAXJMP(0x47A000); } WRAPPER void CFireManager::SetScriptFireAudio(int16, bool) { EAXJMP(0x47A040); } + +STARTPATCHES + InjectHook(0x479DB0, &CFireManager::ExtinguishPoint, PATCH_JUMP); + InjectHook(0x479340, &CFireManager::FindNearestFire, PATCH_JUMP); +ENDPATCHES + |