summaryrefslogtreecommitdiffstats
path: root/src/peds/Ped.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/peds/Ped.cpp')
-rw-r--r--src/peds/Ped.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp
index 785050c9..12b4ef8d 100644
--- a/src/peds/Ped.cpp
+++ b/src/peds/Ped.cpp
@@ -19167,10 +19167,11 @@ CPed::AttachPedToEntity(CEntity *ent, CVector offset, uint16 type, float rot, eW
void
CPed::DettachPedFromEntity(void)
{
+ CEntity* pVehicleAttachedTo = m_attachedTo;
m_attachedTo = nil;
if (m_nPedState == PED_DIE) {
- m_pCollidingEntity = m_attachedTo;
- ApplyMoveForce(m_attachedTo->GetForward() * -4.0f);
+ m_pCollidingEntity = pVehicleAttachedTo;
+ ApplyMoveForce(pVehicleAttachedTo->GetForward() * -4.0f);
bIsStanding = false;
} else if (m_nPedState != PED_DEAD) {
RestorePreviousState();