From 8dc75e7091d4aa1d018f4f5f54bb78277023eaeb Mon Sep 17 00:00:00 2001 From: Subv2112 Date: Thu, 2 Feb 2012 13:03:54 -0500 Subject: Codestyle: Converted some casts to their respective ToClass() --- src/server/game/Entities/Object/Object.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 7cedaa086d3..decb3230a7b 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -1543,12 +1543,12 @@ void WorldObject::UpdateAllowedPositionZ(float x, float y, float &z) const { // non fly unit don't must be in air // non swim unit must be at ground (mostly speedup, because it don't must be in water and water level check less fast - if (!((Creature const*)this)->canFly()) + if (!ToCreature()->canFly()) { - bool canSwim = ((Creature const*)this)->canSwim(); + bool canSwim = ToCreature()->canSwim(); float ground_z = z; float max_z = canSwim - ? GetBaseMap()->GetWaterOrGroundLevel(x, y, z, &ground_z, !((Unit const*)this)->HasAuraType(SPELL_AURA_WATER_WALK)) + ? GetBaseMap()->GetWaterOrGroundLevel(x, y, z, &ground_z, !ToUnit()->HasAuraType(SPELL_AURA_WATER_WALK)) : ((ground_z = GetBaseMap()->GetHeight(x, y, z, true))); if (max_z > INVALID_HEIGHT) { @@ -1569,10 +1569,10 @@ void WorldObject::UpdateAllowedPositionZ(float x, float y, float &z) const case TYPEID_PLAYER: { // for server controlled moves playr work same as creature (but it can always swim) - if (!((Player const*)this)->canFly()) + if (!ToPlayer()->canFly()) { float ground_z = z; - float max_z = GetBaseMap()->GetWaterOrGroundLevel(x, y, z, &ground_z, !((Unit const*)this)->HasAuraType(SPELL_AURA_WATER_WALK)); + float max_z = GetBaseMap()->GetWaterOrGroundLevel(x, y, z, &ground_z, !(ToUnit()->HasAuraType(SPELL_AURA_WATER_WALK)); if (max_z > INVALID_HEIGHT) { if (z > max_z) -- cgit v1.2.3