Revert "Core/Entities: implement IsInAir"

This reverts commit 4c27329bed.
This commit is contained in:
Shauren
2025-10-26 09:56:22 +01:00
parent ea6bb10d12
commit 7c006ed265
3 changed files with 4 additions and 7 deletions

View File

@@ -2651,7 +2651,10 @@ void Creature::UpdateMovementFlags()
return;
// Set the movement flags if the creature is in that mode. (Only fly if actually in air, only swim if in water, etc)
bool isInAir = IsInAir(*this, GetFloorZ() + GROUND_HEIGHT_TOLERANCE) || IsInAir(*this, GetFloorZ() - GROUND_HEIGHT_TOLERANCE);
float ground = GetFloorZ();
bool canHover = CanHover();
bool isInAir = (G3D::fuzzyGt(GetPositionZ(), ground + (canHover ? GetFloatValue(UNIT_FIELD_HOVERHEIGHT) : 0.0f) + GROUND_HEIGHT_TOLERANCE) || G3D::fuzzyLt(GetPositionZ(), ground - GROUND_HEIGHT_TOLERANCE)); // Can be underground too, prevent the falling
if (GetMovementTemplate().IsFlightAllowed() && isInAir && !IsFalling())
{

View File

@@ -3164,11 +3164,6 @@ bool Unit::IsUnderWater() const
return GetLiquidStatus() & LIQUID_MAP_UNDER_WATER;
}
bool Unit::IsInAir(Position const destination, float destinationFloor, bool honorHover/* = true*/) const
{
return std::fabs(destination.GetPositionZ() - (honorHover ? GetHoverOffset() : 0.f) - destinationFloor) > 0.1f;
}
void Unit::ProcessPositionDataChanged(PositionFullTerrainStatus const& data)
{
ZLiquidStatus oldLiquidStatus = GetLiquidStatus();

View File

@@ -1171,7 +1171,6 @@ class TC_GAME_API Unit : public WorldObject
bool IsInWater() const;
bool IsUnderWater() const;
bool IsInAir(Position const destination, float destinationFloor, bool honorHover = true) const;
bool isInAccessiblePlaceFor(Creature const* c) const;
void SendHealSpellLog(HealInfo& healInfo, bool critical = false);