Fix Crash in Unit::GetVehicleCreatureBase. Thanks proof1337.
Fixes issue #821. --HG-- branch : trunk
This commit is contained in:
+2
-2
@@ -15213,8 +15213,8 @@ Unit *Unit::GetVehicleBase() const
|
|||||||
Creature *Unit::GetVehicleCreatureBase() const
|
Creature *Unit::GetVehicleCreatureBase() const
|
||||||
{
|
{
|
||||||
Unit *veh = GetVehicleBase();
|
Unit *veh = GetVehicleBase();
|
||||||
if (veh->GetTypeId() == TYPEID_UNIT)
|
if (veh && veh->GetTypeId() == TYPEID_UNIT)
|
||||||
return (Creature*)veh;
|
return dynamic_cast<Creature*>(veh);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user