Core/Creatures: fixed a issue where creatures that are walking on puddles are considered swimming so their gravity got enabled.

This commit is contained in:
Ovahlord committed 2018-03-30 00:29:13 +02:00
1 parent 2efc91a839
commit 261fbb29e8
2 files changed
+3 -10

No files matched your search

+2 -1
View File
@@ -14152,7 +14152,8 @@ bool Unit::SetSwim(bool enable)
if (enable)
{
AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING);
SetDisableGravity(true);
if (IsUnderWater())
SetDisableGravity(true);
}
else
{
+1 -9
View File
@@ -2338,15 +2338,7 @@ float Map::GetWaterOrGroundLevel(PhaseShift const& phaseShift, float x, float y,
LiquidData liquid_status;
ZLiquidStatus res = GetLiquidStatus(phaseShift, x, y, ground_z, MAP_ALL_LIQUIDS, &liquid_status);
switch (res)
{
case LIQUID_MAP_ABOVE_WATER:
return std::max<float>(liquid_status.level, ground_z);
case LIQUID_MAP_NO_WATER:
return ground_z;
default:
return liquid_status.level;
}
return res ? liquid_status.level : ground_z;
}
return VMAP_INVALID_HEIGHT_VALUE;