Skip to content

Commit 288be73

Browse files
committed
Revert "Core/Entities: handle more edge cases in IsInAir"
This reverts commit 00ddc35.
1 parent dc8c29c commit 288be73

1 file changed

Lines changed: 1 addition & 11 deletions

File tree

src/server/game/Entities/Unit/Unit.cpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3166,17 +3166,7 @@ bool Unit::IsUnderWater() const
31663166

31673167
bool Unit::IsInAir(Position const destination, float destinationFloor, bool honorHover/* = true*/) const
31683168
{
3169-
float z = destination.GetPositionZ();
3170-
if (z < destinationFloor - 0.5f) // if really bellow ground, in air (caves,...)
3171-
return true;
3172-
float hoverHeight = GetHoverOffset(); // height if currently hovering
3173-
if (GetTypeId() == TYPEID_UNIT) {
3174-
hoverHeight = ToCreature()->CanHover() ? GetFloatValue(UNIT_FIELD_HOVERHEIGHT) : 0.f; // height if could hover
3175-
}
3176-
z = destination.GetPositionZ() - (honorHover ? hoverHeight : 0.f);
3177-
if (z <= destinationFloor + 0.5f) // if is bellow ground or slightly above it, not in air - should hover too
3178-
return false;
3179-
return std::fabs(z - destinationFloor) > 0.5f; // if the difference is higher than tolerance level, in air (todo: this should most likely take into account unit's "size")
3169+
return std::fabs(destination.GetPositionZ() - (honorHover ? GetHoverOffset() : 0.f) - destinationFloor) > 0.1f;
31803170
}
31813171

31823172
void Unit::ProcessPositionDataChanged(PositionFullTerrainStatus const& data)

0 commit comments

Comments
 (0)