summaryrefslogtreecommitdiffstats
path: root/src/peds/EmergencyPed.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/peds/EmergencyPed.cpp')
-rw-r--r--src/peds/EmergencyPed.cpp33
1 files changed, 11 insertions, 22 deletions
diff --git a/src/peds/EmergencyPed.cpp b/src/peds/EmergencyPed.cpp
index 8d6999c3..5b91daad 100644
--- a/src/peds/EmergencyPed.cpp
+++ b/src/peds/EmergencyPed.cpp
@@ -44,15 +44,12 @@ CEmergencyPed::InRange(CPed *victim)
void
CEmergencyPed::ProcessControl(void)
{
- if (m_nZoneLevel > LEVEL_GENERIC && m_nZoneLevel != CCollision::ms_collisionInMemory)
- return;
-
CPed::ProcessControl();
if (bWasPostponed)
return;
if(!DyingOrDead()) {
- GetWeapon()->Update(m_audioEntityId);
+ GetWeapon()->Update(m_audioEntityId, nil);
if (IsPedInControl() && m_moved.Magnitude() > 0.0f)
Avoid();
@@ -107,7 +104,6 @@ CEmergencyPed::FiremanAI(void)
m_pAttendedFire = nearestFire;
#ifdef FIX_BUGS
bIsRunning = true;
- ++nearestFire->m_nFiremenPuttingOut;
#endif
}
break;
@@ -119,10 +115,6 @@ CEmergencyPed::FiremanAI(void)
SetMoveState(PEDMOVE_RUN);
#ifdef FIX_BUGS
bIsRunning = true;
- if (m_pAttendedFire) {
- --m_pAttendedFire->m_nFiremenPuttingOut;
- }
- ++nearestFire->m_nFiremenPuttingOut;
m_pAttendedFire = nearestFire;
} else if (!nearestFire) {
#else
@@ -156,10 +148,7 @@ CEmergencyPed::FiremanAI(void)
case EMERGENCY_PED_STOP:
#ifdef FIX_BUGS
bIsRunning = false;
- if (m_pAttendedFire)
#endif
- --m_pAttendedFire->m_nFiremenPuttingOut;
-
m_nPedState = PED_NONE;
SetWanderPath(CGeneral::GetRandomNumber() & 7);
m_pAttendedFire = nil;
@@ -234,8 +223,8 @@ CEmergencyPed::MedicAI(void)
if (nearestAccident) {
m_pRevivedPed = nearestAccident->m_pVictim;
m_pRevivedPed->RegisterReference((CEntity**)&m_pRevivedPed);
- m_pRevivedPed->m_pedIK.GetComponentPosition((RwV3d*)&midPos, PED_MID);
- m_pRevivedPed->m_pedIK.GetComponentPosition((RwV3d*)&headPos, PED_HEAD);
+ m_pRevivedPed->m_pedIK.GetComponentPosition(*(RwV3d *)&midPos, PED_MID);
+ m_pRevivedPed->m_pedIK.GetComponentPosition(*(RwV3d *)&headPos, PED_HEAD);
SetSeek((headPos + midPos) * 0.5f, 1.0f);
SetObjective(OBJECTIVE_NONE);
bIsRunning = true;
@@ -274,8 +263,8 @@ CEmergencyPed::MedicAI(void)
m_nEmergencyPedState = EMERGENCY_PED_STOP;
break;
}
- m_pRevivedPed->m_pedIK.GetComponentPosition((RwV3d*)&midPos, PED_MID);
- m_pRevivedPed->m_pedIK.GetComponentPosition((RwV3d*)&headPos, PED_HEAD);
+ m_pRevivedPed->m_pedIK.GetComponentPosition(*(RwV3d *)&midPos, PED_MID);
+ m_pRevivedPed->m_pedIK.GetComponentPosition(*(RwV3d *)&headPos, PED_HEAD);
SetSeek((headPos + midPos) * 0.5f, nearestAccident->m_nMedicsPerformingCPR * 0.5f + 1.0f);
SetObjective(OBJECTIVE_NONE);
bIsRunning = true;
@@ -311,13 +300,13 @@ CEmergencyPed::MedicAI(void)
m_nLastPedState = PED_CPR;
SetLookFlag(m_pRevivedPed, 0);
SetLookTimer(500);
- Say(SOUND_PED_HEALING);
+ //Say(SOUND_PED_HEALING);
if (m_pAttendedAccident->m_nMedicsPerformingCPR) {
SetIdle();
m_nEmergencyPedState = EMERGENCY_PED_STAND_STILL;
} else {
m_nEmergencyPedState = EMERGENCY_PED_FACE_TO_PATIENT;
- m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_CPR, 4.0f);
+ m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_MEDIC, ANIM_CPR, 4.0f);
bIsDucking = true;
}
SetLookTimer(2000);
@@ -329,8 +318,8 @@ CEmergencyPed::MedicAI(void)
if (!m_pRevivedPed || m_pRevivedPed->m_fHealth > 0.0f)
m_nEmergencyPedState = EMERGENCY_PED_DETERMINE_NEXT_STATE;
else {
- m_pRevivedPed->m_pedIK.GetComponentPosition((RwV3d*)&midPos, PED_MID);
- m_pRevivedPed->m_pedIK.GetComponentPosition((RwV3d*)&headPos, PED_HEAD);
+ m_pRevivedPed->m_pedIK.GetComponentPosition(*(RwV3d *)&midPos, PED_MID);
+ m_pRevivedPed->m_pedIK.GetComponentPosition(*(RwV3d *)&headPos, PED_HEAD);
midPos = (headPos + midPos) * 0.5f;
m_fRotationDest = CGeneral::GetRadianAngleBetweenPoints(
midPos.x, midPos.y,
@@ -351,8 +340,8 @@ CEmergencyPed::MedicAI(void)
m_nEmergencyPedState = EMERGENCY_PED_DETERMINE_NEXT_STATE;
break;
}
- m_pRevivedPed->m_pedIK.GetComponentPosition((RwV3d*)&midPos, PED_MID);
- m_pRevivedPed->m_pedIK.GetComponentPosition((RwV3d*)&headPos, PED_HEAD);
+ m_pRevivedPed->m_pedIK.GetComponentPosition(*(RwV3d *)&midPos, PED_MID);
+ m_pRevivedPed->m_pedIK.GetComponentPosition(*(RwV3d *)&headPos, PED_HEAD);
midPos = (headPos + midPos) * 0.5f;
m_fRotationDest = CGeneral::GetRadianAngleBetweenPoints(
midPos.x, midPos.y,