diff options
author | SmallJoker <SmallJoker@users.noreply.github.com> | 2021-09-27 17:45:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-27 17:45:44 +0200 |
commit | d51d0f3a5a60679436bf7d4e1980f3a82f229848 (patch) | |
tree | e6d15df599dd04df76b8493a4cdcaf6b550c4cce /src/client/camera.cpp | |
parent | 918fbe3ec1667c65a320f1f6b432449f104d8e26 (diff) | |
download | minetest-d51d0f3a5a60679436bf7d4e1980f3a82f229848.tar.xz |
Various code improvements
* Camera: Fix division by 0 after view bobbing
* Remove ignored constness
* Connection: Improve window size range limits
Diffstat (limited to 'src/client/camera.cpp')
-rw-r--r-- | src/client/camera.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/client/camera.cpp b/src/client/camera.cpp index 2629a6359..48e60c433 100644 --- a/src/client/camera.cpp +++ b/src/client/camera.cpp @@ -378,7 +378,8 @@ void Camera::update(LocalPlayer* player, f32 frametime, f32 busytime, f32 tool_r // Smoothen and invert the above fall_bobbing = sin(fall_bobbing * 0.5 * M_PI) * -1; // Amplify according to the intensity of the impact - fall_bobbing *= (1 - rangelim(50 / player->camera_impact, 0, 1)) * 5; + if (player->camera_impact > 0.0f) + fall_bobbing *= (1 - rangelim(50 / player->camera_impact, 0, 1)) * 5; fall_bobbing *= m_cache_fall_bobbing_amount; } |