diff options
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r-- | src/game/Unit.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index c11bff030c1..1b7813d6bbb 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -15287,9 +15287,10 @@ Unit *Unit::GetVehicleBase() const Creature *Unit::GetVehicleCreatureBase() const { - Unit *veh = GetVehicleBase(); - if (veh && veh->GetTypeId() == TYPEID_UNIT) - return dynamic_cast<Creature*>(veh); + if( Unit *veh = GetVehicleBase()) + if( Creature *c = veh->ToCreature()) + return c; + return NULL; } |