diff options
author | eray orçunus <erayorcunus@gmail.com> | 2019-12-22 16:28:16 +0100 |
---|---|---|
committer | eray orçunus <erayorcunus@gmail.com> | 2019-12-22 16:28:16 +0100 |
commit | 04499bfbb69f4be525479cd1b8bf2c6d88c16fd4 (patch) | |
tree | 32108d0204bd8d51c203fb9d553c52df816befbf /src/control | |
parent | Merge pull request #281 from erorcun/erorcun (diff) | |
download | re3-04499bfbb69f4be525479cd1b8bf2c6d88c16fd4.tar re3-04499bfbb69f4be525479cd1b8bf2c6d88c16fd4.tar.gz re3-04499bfbb69f4be525479cd1b8bf2c6d88c16fd4.tar.bz2 re3-04499bfbb69f4be525479cd1b8bf2c6d88c16fd4.tar.lz re3-04499bfbb69f4be525479cd1b8bf2c6d88c16fd4.tar.xz re3-04499bfbb69f4be525479cd1b8bf2c6d88c16fd4.tar.zst re3-04499bfbb69f4be525479cd1b8bf2c6d88c16fd4.zip |
Diffstat (limited to 'src/control')
-rw-r--r-- | src/control/AccidentManager.cpp | 16 | ||||
-rw-r--r-- | src/control/AccidentManager.h | 1 |
2 files changed, 15 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 diff --git a/src/control/AccidentManager.h b/src/control/AccidentManager.h index 6d7f25c8..6a3088e7 100644 --- a/src/control/AccidentManager.h +++ b/src/control/AccidentManager.h @@ -21,6 +21,7 @@ class CAccidentManager }; public: uint16 CountActiveAccidents(); + bool UnattendedAccidents(); CAccident* FindNearestAccident(CVector, float*); void Update(void); }; |