summaryrefslogtreecommitdiffstats
path: root/src/control/AccidentManager.cpp
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-01-01 00:42:00 +0100
committerNikolay Korolev <nickvnuk@gmail.com>2020-01-01 00:42:00 +0100
commit5b0cf80a76e49cee88e796bb8c4b53fd3ca8f3c5 (patch)
tree2e2bca559ef34473733d63a022c74a711c894830 /src/control/AccidentManager.cpp
parentsome not fully tested stuff (diff)
parentmaking particleobject compile on vs2015 (diff)
downloadre3-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/control/AccidentManager.cpp')
-rw-r--r--src/control/AccidentManager.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/control/AccidentManager.cpp b/src/control/AccidentManager.cpp
index 46d254fc..a42280b7 100644
--- a/src/control/AccidentManager.cpp
+++ b/src/control/AccidentManager.cpp
@@ -8,7 +8,8 @@ CAccidentManager& gAccidentManager = *(CAccidentManager*)0x87FD10;
WRAPPER void CAccidentManager::Update(void) { EAXJMP(0x456710); }
-uint16 CAccidentManager::CountActiveAccidents()
+uint16
+CAccidentManager::CountActiveAccidents()
{
uint16 accidents = 0;
for (int i = 0; i < NUM_ACCIDENTS; i++){
@@ -18,7 +19,8 @@ uint16 CAccidentManager::CountActiveAccidents()
return accidents;
}
-CAccident* CAccidentManager::FindNearestAccident(CVector vecPos, float* pDistance)
+CAccident*
+CAccidentManager::FindNearestAccident(CVector vecPos, float* pDistance)
{
for (int i = 0; i < MAX_MEDICS_TO_ATTEND_ACCIDENT; i++){
int accidentId = -1;
@@ -44,4 +46,14 @@ CAccident* CAccidentManager::FindNearestAccident(CVector vecPos, float* pDistanc
return &m_aAccidents[accidentId];
}
return nil;
+}
+
+bool
+CAccidentManager::UnattendedAccidents(void)
+{
+ for (int i = 0; i < NUM_ACCIDENTS; i++) {
+ if (m_aAccidents[i].m_pVictim && m_aAccidents[i].m_nMedicsAttending == 0)
+ return true;
+ }
+ return false;
} \ No newline at end of file