Skip to content

Commit

Permalink
Fix disappearing of wielditem
Browse files Browse the repository at this point in the history
  • Loading branch information
PilzAdam committed May 21, 2013
1 parent 4a9fe1a commit 7f6e9e9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/camera.cpp
Expand Up @@ -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);
Expand Down

0 comments on commit 7f6e9e9

Please sign in to comment.