Partial: Core/Entities: Reduce the probability of units dropping under the map (#21322)

Reduce the probabilty of going under the map

(cherry picked from commit 9e0faace9a5114fc2324c2c601ba943272e0d6ff)

Revert "Core/Entities: Reduce the probability of units dropping under the map (#21322)"

(cherry picked from commit 2dadbda24ac1c2e6ff3dad650c7e25f4b3322342)
This commit is contained in:
Jeremy
2021-08-08 21:21:34 +02:00
committed by funjoker
parent fcead0b4ea
commit 69edf282fa
3 changed files with 28 additions and 3 deletions
+2 -2
View File
@@ -1327,7 +1327,7 @@ void WorldObject::UpdateAllowedPositionZ(float x, float y, float &z) const
else
{
float ground_z = GetMapHeight(x, y, z);
if (z < ground_z)
if (std::fabs(z - ground_z) < GetCollisionHeight())
z = ground_z;
}
break;
@@ -1350,7 +1350,7 @@ void WorldObject::UpdateAllowedPositionZ(float x, float y, float &z) const
else
{
float ground_z = GetMapHeight(x, y, z);
if (z < ground_z)
if (std::fabs(z - ground_z) < GetCollisionHeight())
z = ground_z;
}
break;