From 6e33427a114e9702f1152cc70b8316ce43b56e13 Mon Sep 17 00:00:00 2001 From: megamage Date: Sat, 28 Mar 2009 10:50:54 -0600 Subject: *Exit vehicle when players or vehicles are dead. This may fix some crash. --HG-- branch : trunk --- src/game/Vehicle.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/game/Vehicle.cpp') 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); } -- cgit v1.2.3