Use static cast in IsPet and ToPet.

This commit is contained in:
ratkosrb
2019-01-12 03:03:58 +02:00
parent b030cd500a
commit 59f151f0f1
+3 -3
View File
@@ -2630,17 +2630,17 @@ void WorldObject::GetFirstCollision(float dist, float angle, float &x, float &y,
bool Object::IsPet() const
{
return IsCreature() && ToCreature()->IsPet();
return IsCreature() && static_cast<Creature const*>(this)->IsPet();
}
Pet const* Object::ToPet() const
{
return IsPet() ? (Pet const*)this : NULL;
return IsPet() ? static_cast<Pet const*>(this) : nullptr;
}
Pet* Object::ToPet()
{
return IsPet() ? (Pet*)this : NULL;
return IsPet() ? static_cast<Pet*>(this) : nullptr;
}
bool WorldObject::PrintCoordinatesError(float x, float y, float z, char const* descr) const