Core/Movement: ported most movement updates from master branch and corrected behavior of CREATURE_STATIC_FLAG_4_PREVENT_SWIM
This commit is contained in:
1 parent
83958342d9
commit
2953efb7a3
22 files changed
+306
-314
No files matched your search
@@ -3710,9 +3710,17 @@ float WorldObject::GetFloorZ() const
|
||||
|
||||
float WorldObject::GetMapWaterOrGroundLevel(float x, float y, float z, float* ground/* = nullptr*/) const
|
||||
{
|
||||
return GetMap()->GetWaterOrGroundLevel(GetPhaseShift(), x, y, z, ground,
|
||||
isType(TYPEMASK_UNIT) ? !static_cast<Unit const*>(this)->HasAuraType(SPELL_AURA_WATER_WALK) : false,
|
||||
GetCollisionHeight());
|
||||
bool swimming = [&]()
|
||||
{
|
||||
if (Creature const* creature = ToCreature())
|
||||
return (!creature->CannotPenetrateWater() && !creature->HasAuraType(SPELL_AURA_WATER_WALK));
|
||||
else if (Unit const* unit = ToUnit())
|
||||
return !unit->HasAuraType(SPELL_AURA_WATER_WALK);
|
||||
|
||||
return true;
|
||||
}();
|
||||
|
||||
return GetMap()->GetWaterOrGroundLevel(GetPhaseShift(), x, y, z, ground, swimming, GetCollisionHeight());
|
||||
}
|
||||
|
||||
float WorldObject::GetMapHeight(float x, float y, float z, bool vmap/* = true*/, float distanceToSearch/* = DEFAULT_HEIGHT_SEARCH*/) const
|
||||
|
||||
Reference in new issue
Block a user