From 8b3135a64350a045dbb0b9a6ce1dad61cba0c532 Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Thu, 28 Aug 2014 20:22:19 -0400 Subject: [PATCH] Only set player dirty flag if values change --- src/player.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/player.h b/src/player.h index 174f1472..aa38996a 100644 --- a/src/player.h +++ b/src/player.h @@ -142,19 +142,22 @@ public: virtual void setPosition(const v3f &position) { - m_dirty = true; + if (position != m_position) + m_dirty = true; m_position = position; } void setPitch(f32 pitch) { - m_dirty = true; + if (pitch != m_pitch) + m_dirty = true; m_pitch = pitch; } virtual void setYaw(f32 yaw) { - m_dirty = true; + if (yaw != m_yaw) + m_dirty = true; m_yaw = yaw; } @@ -175,7 +178,8 @@ public: virtual void setBreath(u16 breath) { - m_dirty = true; + if (breath != m_breath) + m_dirty = true; m_breath = breath; }