mirror of
https://github.com/minetest/minetest.git
synced 2025-06-30 23:20:22 +02:00
Various code improvements
* Camera: Fix division by 0 after view bobbing * Remove ignored constness * Connection: Improve window size range limits
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user