Add a sanity check to prevent mobs climbing steep walls

Ex. in OMM's room in anguish
This commit is contained in:
Michael Cook (mackal) 2018-03-17 14:29:11 -04:00
parent 0643bf9783
commit c29bdd4b1d

View File

@ -1023,6 +1023,8 @@ void Mob::ProcessForcedMovement()
pLastChange = Timer::GetCurrentTime();
FixZ(); // so we teleport to the ground locally, we want the client to interpolate falling etc
} else if (--ForcedMovement) {
if (normal.z < -0.15f) // prevent too much wall climbing. ex. OMM's room in anguish
normal.z = 0.0f;
auto proj = glm::proj(static_cast<glm::vec3>(m_Delta), normal);
m_Delta.x -= proj.x;
m_Delta.y -= proj.y;