summaryrefslogtreecommitdiffstats
path: root/src/peds/Ped.cpp
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-06-05 10:22:15 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2020-06-05 10:22:15 +0200
commitd325a3d2478c6933edf6aa145481e3b8fcbe5853 (patch)
treee354dec17e72b67b3b9e4b8168e9519b9cab50b9 /src/peds/Ped.cpp
parentmore CBike (diff)
downloadre3-d325a3d2478c6933edf6aa145481e3b8fcbe5853.tar
re3-d325a3d2478c6933edf6aa145481e3b8fcbe5853.tar.gz
re3-d325a3d2478c6933edf6aa145481e3b8fcbe5853.tar.bz2
re3-d325a3d2478c6933edf6aa145481e3b8fcbe5853.tar.lz
re3-d325a3d2478c6933edf6aa145481e3b8fcbe5853.tar.xz
re3-d325a3d2478c6933edf6aa145481e3b8fcbe5853.tar.zst
re3-d325a3d2478c6933edf6aa145481e3b8fcbe5853.zip
Diffstat (limited to '')
-rw-r--r--src/peds/Ped.cpp57
1 files changed, 33 insertions, 24 deletions
diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp
index e404463e..2d5d953e 100644
--- a/src/peds/Ped.cpp
+++ b/src/peds/Ped.cpp
@@ -4270,33 +4270,40 @@ CPed::InflictDamage(CEntity *damagedBy, eWeaponType method, float damage, ePedPi
if (method != WEAPONTYPE_DROWNING) {
#ifdef VC_PED_PORTS
if (m_pMyVehicle) {
-
- // TODO(Miami): Bikes
- if (m_pMyVehicle->IsCar() && m_pMyVehicle->pDriver == this) {
- if (m_pMyVehicle->GetStatus() == STATUS_SIMPLE) {
- m_pMyVehicle->SetStatus(STATUS_PHYSICS);
- CCarCtrl::SwitchVehicleToRealPhysics(m_pMyVehicle);
- }
- m_pMyVehicle->AutoPilot.m_nCarMission = MISSION_NONE;
- m_pMyVehicle->AutoPilot.m_nCruiseSpeed = 0;
- m_pMyVehicle->AutoPilot.m_nTempAction = TEMPACT_HANDBRAKESTRAIGHT;
- m_pMyVehicle->AutoPilot.m_nTimeTempAction = CTimer::GetTimeInMilliseconds() + 2000;
- }
-// TODO(MIAMI): argument
- if (m_pMyVehicle->CanPedExitCar(false)) {
- SetObjective(OBJECTIVE_LEAVE_CAR_AND_DIE, m_pMyVehicle);
- } else {
+ bool bDone = false;
+ if (m_pMyVehicle->IsBike()) {
m_fHealth = 0.0f;
- if (m_pMyVehicle && m_pMyVehicle->pDriver == this) {
- SetRadioStation();
- m_pMyVehicle->SetStatus(STATUS_ABANDONED);
+ //CBike::KnockOffRider -- TODO(MIAMI)
+ bDone = true;
+ }
+ else {
+ if (m_pMyVehicle->IsCar() && m_pMyVehicle->pDriver == this) {
+ if (m_pMyVehicle->GetStatus() == STATUS_SIMPLE) {
+ m_pMyVehicle->SetStatus(STATUS_PHYSICS);
+ CCarCtrl::SwitchVehicleToRealPhysics(m_pMyVehicle);
+ }
+ m_pMyVehicle->AutoPilot.m_nCarMission = MISSION_NONE;
+ m_pMyVehicle->AutoPilot.m_nCruiseSpeed = 0;
+ m_pMyVehicle->AutoPilot.m_nTempAction = TEMPACT_HANDBRAKESTRAIGHT;
+ m_pMyVehicle->AutoPilot.m_nTimeTempAction = CTimer::GetTimeInMilliseconds() + 2000;
}
- SetDie(dieAnim, dieDelta, dieSpeed);
- /*
- if (damagedBy == FindPlayerPed() && damagedBy != this) {
- // TODO(Miami): PlayerInfo stuff
+ // TODO(MIAMI): argument
+ if (m_pMyVehicle->CanPedExitCar(false)) {
+ SetObjective(OBJECTIVE_LEAVE_CAR_AND_DIE, m_pMyVehicle);
+ }
+ else {
+ m_fHealth = 0.0f;
+ if (m_pMyVehicle && m_pMyVehicle->pDriver == this) {
+ SetRadioStation();
+ m_pMyVehicle->SetStatus(STATUS_ABANDONED);
+ }
+ SetDie(dieAnim, dieDelta, dieSpeed);
+ /*
+ if (damagedBy == FindPlayerPed() && damagedBy != this) {
+ // TODO(Miami): PlayerInfo stuff
+ }
+ */
}
- */
}
for (int i = 0; i < ARRAY_SIZE(m_pMyVehicle->pPassengers); i++) {
CPed* passenger = m_pMyVehicle->pPassengers[i];
@@ -4314,6 +4321,8 @@ CPed::InflictDamage(CEntity *damagedBy, eWeaponType method, float damage, ePedPi
} else {
CDarkel::RegisterKillNotByPlayer(this, method);
}
+ if (bDone)
+ return true;
}
#endif
m_fHealth = 1.0f;