summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-06-07 17:19:44 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2020-06-07 17:19:44 +0200
commit1748aabd6960db4fc39159d6dfbfef9d25e0f814 (patch)
tree951ed684dbc360555137bcabb9607ff8ffac391e /src
parentfix (diff)
downloadre3-1748aabd6960db4fc39159d6dfbfef9d25e0f814.tar
re3-1748aabd6960db4fc39159d6dfbfef9d25e0f814.tar.gz
re3-1748aabd6960db4fc39159d6dfbfef9d25e0f814.tar.bz2
re3-1748aabd6960db4fc39159d6dfbfef9d25e0f814.tar.lz
re3-1748aabd6960db4fc39159d6dfbfef9d25e0f814.tar.xz
re3-1748aabd6960db4fc39159d6dfbfef9d25e0f814.tar.zst
re3-1748aabd6960db4fc39159d6dfbfef9d25e0f814.zip
Diffstat (limited to 'src')
-rw-r--r--src/peds/Ped.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp
index 744ba793..56d7556b 100644
--- a/src/peds/Ped.cpp
+++ b/src/peds/Ped.cpp
@@ -4370,6 +4370,7 @@ CPed::InflictDamage(CEntity *damagedBy, eWeaponType method, float damage, ePedPi
if (bInVehicle) {
if (method != WEAPONTYPE_DROWNING) {
if (m_pMyVehicle) {
+ CVehicle* pVehicle = m_pMyVehicle;
bool bDone = false;
if (m_pMyVehicle->IsBike()) {
m_fHealth = 0.0f;
@@ -4405,13 +4406,13 @@ CPed::InflictDamage(CEntity *damagedBy, eWeaponType method, float damage, ePedPi
*/
}
}
- for (int i = 0; i < ARRAY_SIZE(m_pMyVehicle->pPassengers); i++) {
- CPed* passenger = m_pMyVehicle->pPassengers[i];
+ for (int i = 0; i < ARRAY_SIZE(pVehicle->pPassengers); i++) {
+ CPed* passenger = pVehicle->pPassengers[i];
if (passenger && passenger != this && damagedBy)
passenger->ReactToAttack(damagedBy);
}
- CPed *driverOfVeh = m_pMyVehicle->pDriver;
+ CPed *driverOfVeh = pVehicle->pDriver;
if (driverOfVeh && driverOfVeh != this && damagedBy)
driverOfVeh->ReactToAttack(damagedBy);