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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user