diff options
author | Trazom62 <none@none> | 2010-02-25 19:15:35 +0100 |
---|---|---|
committer | Trazom62 <none@none> | 2010-02-25 19:15:35 +0100 |
commit | 1ce8d641f4229312c2c3167652daf2bab5acf330 (patch) | |
tree | d13ed9e19c89b2299ce55f4c6a83b3779bf929a6 /src | |
parent | cb5ffcafdbcd4dde38d51e1af3870870b3479b78 (diff) |
Fix Crash in Unit::GetVehicleCreatureBase. Thanks proof1337.
Fixes issue #821.
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Unit.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index a1c6a5d272d..e92fcfad94f 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -15213,8 +15213,8 @@ Unit *Unit::GetVehicleBase() const Creature *Unit::GetVehicleCreatureBase() const { Unit *veh = GetVehicleBase(); - if (veh->GetTypeId() == TYPEID_UNIT) - return (Creature*)veh; + if (veh && veh->GetTypeId() == TYPEID_UNIT) + return dynamic_cast<Creature*>(veh); return NULL; } |