summaryrefslogtreecommitdiffstats
path: root/src/control/AccidentManager.cpp
diff options
context:
space:
mode:
authorerorcun <erayorcunus@gmail.com>2020-01-12 00:11:47 +0100
committerGitHub <noreply@github.com>2020-01-12 00:11:47 +0100
commit2d00d7b3e2026283498c6274ae2533211ea48f53 (patch)
treedc5d7e408858a5574d70d927eee670f1c9165cc6 /src/control/AccidentManager.cpp
parentMerge pull request #292 from erorcun/erorcun (diff)
parentAccidentManager (diff)
downloadre3-2d00d7b3e2026283498c6274ae2533211ea48f53.tar
re3-2d00d7b3e2026283498c6274ae2533211ea48f53.tar.gz
re3-2d00d7b3e2026283498c6274ae2533211ea48f53.tar.bz2
re3-2d00d7b3e2026283498c6274ae2533211ea48f53.tar.lz
re3-2d00d7b3e2026283498c6274ae2533211ea48f53.tar.xz
re3-2d00d7b3e2026283498c6274ae2533211ea48f53.tar.zst
re3-2d00d7b3e2026283498c6274ae2533211ea48f53.zip
Diffstat (limited to 'src/control/AccidentManager.cpp')
-rw-r--r--src/control/AccidentManager.cpp59
1 files changed, 0 insertions, 59 deletions
diff --git a/src/control/AccidentManager.cpp b/src/control/AccidentManager.cpp
deleted file mode 100644
index a42280b7..00000000
--- a/src/control/AccidentManager.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-#include "common.h"
-#include "patcher.h"
-#include "AccidentManager.h"
-
-#include "Ped.h"
-
-CAccidentManager& gAccidentManager = *(CAccidentManager*)0x87FD10;
-
-WRAPPER void CAccidentManager::Update(void) { EAXJMP(0x456710); }
-
-uint16
-CAccidentManager::CountActiveAccidents()
-{
- uint16 accidents = 0;
- for (int i = 0; i < NUM_ACCIDENTS; i++){
- if (m_aAccidents[i].m_pVictim)
- accidents++;
- }
- return accidents;
-}
-
-CAccident*
-CAccidentManager::FindNearestAccident(CVector vecPos, float* pDistance)
-{
- for (int i = 0; i < MAX_MEDICS_TO_ATTEND_ACCIDENT; i++){
- int accidentId = -1;
- float minDistance = 999999;
- for (int j = 0; j < NUM_ACCIDENTS; j++){
- CPed* pVictim = m_aAccidents[j].m_pVictim;
- if (!pVictim)
- continue;
- if (pVictim->CharCreatedBy == MISSION_CHAR)
- continue;
- if (pVictim->m_fHealth != 0.0f)
- continue;
- if (m_aAccidents[j].m_nMedicsPerformingCPR != i)
- continue;
- float distance = (pVictim->GetPosition() - vecPos).Magnitude2D();
- if (distance / 2 > pVictim->GetPosition().z - vecPos.z && distance < minDistance){
- minDistance = distance;
- accidentId = j;
- }
- }
- *pDistance = minDistance;
- if (accidentId != -1)
- 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