summaryrefslogtreecommitdiffstats
path: root/src/core/Fire.cpp
diff options
context:
space:
mode:
authoreray orçunus <erayorcunus@gmail.com>2019-12-02 21:02:32 +0100
committereray orçunus <erayorcunus@gmail.com>2019-12-05 22:55:23 +0100
commitdad7782ff0be00775f99ad54c656e58b39190b47 (patch)
treee3c8c7402ac4e7403e904d4de9cf43c22b4b0e83 /src/core/Fire.cpp
parentMerge pull request #278 from Fire-Head/master (diff)
downloadre3-dad7782ff0be00775f99ad54c656e58b39190b47.tar
re3-dad7782ff0be00775f99ad54c656e58b39190b47.tar.gz
re3-dad7782ff0be00775f99ad54c656e58b39190b47.tar.bz2
re3-dad7782ff0be00775f99ad54c656e58b39190b47.tar.lz
re3-dad7782ff0be00775f99ad54c656e58b39190b47.tar.xz
re3-dad7782ff0be00775f99ad54c656e58b39190b47.tar.zst
re3-dad7782ff0be00775f99ad54c656e58b39190b47.zip
Diffstat (limited to 'src/core/Fire.cpp')
-rw-r--r--src/core/Fire.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/core/Fire.cpp b/src/core/Fire.cpp
index 0317ccbe..7657d8e9 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); }
CFire* CFireManager::FindNearestFire(CVector vecPos, float* pDistance)
{
@@ -31,6 +34,18 @@ CFire* CFireManager::FindNearestFire(CVector vecPos, float* pDistance)
return nil;
}
-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); }
+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();
+ }
+ }
+}
+
+STARTPATCHES
+ InjectHook(0x479DB0, &CFireManager::ExtinguishPoint, PATCH_JUMP);
+ InjectHook(0x479340, &CFireManager::FindNearestFire, PATCH_JUMP);
+ENDPATCHES \ No newline at end of file