Fix Crash in Unit::GetVehicleCreatureBase. Thanks proof1337.

Fixes issue #821.

--HG--
branch : trunk
This commit is contained in:
Trazom62
2010-02-25 19:15:35 +01:00
parent cb5ffcafdb
commit 1ce8d641f4

View File

@@ -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;
}