Only set player dirty flag if values change

stable-0.4
ShadowNinja 2014-08-28 20:22:19 -04:00
parent cd0df0d5e7
commit 8b3135a643
1 changed files with 8 additions and 4 deletions

View File

@ -142,19 +142,22 @@ public:
virtual void setPosition(const v3f &position) virtual void setPosition(const v3f &position)
{ {
m_dirty = true; if (position != m_position)
m_dirty = true;
m_position = position; m_position = position;
} }
void setPitch(f32 pitch) void setPitch(f32 pitch)
{ {
m_dirty = true; if (pitch != m_pitch)
m_dirty = true;
m_pitch = pitch; m_pitch = pitch;
} }
virtual void setYaw(f32 yaw) virtual void setYaw(f32 yaw)
{ {
m_dirty = true; if (yaw != m_yaw)
m_dirty = true;
m_yaw = yaw; m_yaw = yaw;
} }
@ -175,7 +178,8 @@ public:
virtual void setBreath(u16 breath) virtual void setBreath(u16 breath)
{ {
m_dirty = true; if (breath != m_breath)
m_dirty = true;
m_breath = breath; m_breath = breath;
} }