aboutsummaryrefslogtreecommitdiff
path: root/src/game/Vehicle.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-03-28 10:50:54 -0600
committermegamage <none@none>2009-03-28 10:50:54 -0600
commit6e33427a114e9702f1152cc70b8316ce43b56e13 (patch)
treea197de2513a9662c6e6da092b69ece6cd8b9a0b1 /src/game/Vehicle.cpp
parenta12682a3dd465c514cae29609a3f4c375f4c217d (diff)
*Exit vehicle when players or vehicles are dead. This may fix some crash.
--HG-- branch : trunk
Diffstat (limited to 'src/game/Vehicle.cpp')
-rw-r--r--src/game/Vehicle.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/game/Vehicle.cpp b/src/game/Vehicle.cpp
index 4dd38e9d41e..1a8118c7990 100644
--- a/src/game/Vehicle.cpp
+++ b/src/game/Vehicle.cpp
@@ -52,6 +52,9 @@ void Vehicle::RemoveFromWorld()
void Vehicle::setDeathState(DeathState s) // overwrite virtual Creature::setDeathState and Unit::setDeathState
{
+ if(Unit *charmer = GetCharmer())
+ if(charmer->GetTypeId() == TYPEID_PLAYER)
+ ((Player*)charmer)->ExitVehicle(this);
Creature::setDeathState(s);
}