From ecbc972ea6a2371d64b1d9c9576d31be36b8ae6a Mon Sep 17 00:00:00 2001 From: kilbith Date: Sat, 15 Jul 2017 20:15:36 +0200 Subject: Camera: Fix wieldmesh glitch after teleporting (#6138) --- src/camera.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/camera.cpp b/src/camera.cpp index 35aaeaad4..027e0ffc8 100644 --- a/src/camera.cpp +++ b/src/camera.cpp @@ -215,7 +215,8 @@ static inline v2f dir(const v2f &pos_dist) void Camera::addArmInertia(f32 player_yaw) { - m_cam_vel.X = std::fabs((m_last_cam_pos.X - player_yaw) / 0.016f) * 0.01f; + m_cam_vel.X = std::fabs(rangelim(m_last_cam_pos.X - player_yaw, + -100.0f, 100.0f) / 0.016f) * 0.01f; m_cam_vel.Y = std::fabs((m_last_cam_pos.Y - m_camera_direction.Y) / 0.016f); f32 gap_X = std::fabs(WIELDMESH_OFFSET_X - m_wieldmesh_offset.X); f32 gap_Y = std::fabs(WIELDMESH_OFFSET_Y - m_wieldmesh_offset.Y); -- cgit v1.2.3