From: PilzAdam Date: Tue, 21 May 2013 18:16:22 +0000 (+0200) Subject: Fix disappearing of wielditem X-Git-Tag: 0.4.7~14^2~12 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=7f6e9e9540875c6227cbfb3949af79e59e6a325c;p=oweals%2Fminetest.git Fix disappearing of wielditem --- diff --git a/src/camera.cpp b/src/camera.cpp index acefff7e7..3d8713d6a 100644 --- a/src/camera.cpp +++ b/src/camera.cpp @@ -147,12 +147,13 @@ void Camera::step(f32 dtime) m_view_bobbing_fall = -1; // Mark the effect as finished } + bool was_under_zero = m_wield_change_timer < 0; if(m_wield_change_timer < 0.125) m_wield_change_timer += dtime; if(m_wield_change_timer > 0.125) m_wield_change_timer = 0.125; - if(m_wield_change_timer >= 0 && m_wield_change_timer - dtime < 0) { + if(m_wield_change_timer >= 0 && was_under_zero) { if(m_wield_mesh_next) { m_wieldnode->setMesh(m_wield_mesh_next); m_wieldnode->setVisible(true);