summaryrefslogtreecommitdiff
path: root/src/player.h
diff options
context:
space:
mode:
authorShadowNinja <shadowninja@minetest.net>2014-08-28 20:22:19 -0400
committerShadowNinja <shadowninja@minetest.net>2014-10-01 18:44:36 -0400
commit8b3135a64350a045dbb0b9a6ce1dad61cba0c532 (patch)
tree7fe493ae0a4c287465c1d2146ca936cb1c51dbe0 /src/player.h
parentcd0df0d5e7051763c7ac6ca20a0f2960e0dda83a (diff)
downloadminetest-8b3135a64350a045dbb0b9a6ce1dad61cba0c532.tar.gz
minetest-8b3135a64350a045dbb0b9a6ce1dad61cba0c532.tar.bz2
minetest-8b3135a64350a045dbb0b9a6ce1dad61cba0c532.zip
Only set player dirty flag if values change
Diffstat (limited to 'src/player.h')
-rw-r--r--src/player.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/player.h b/src/player.h
index 174f14728..aa38996a5 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;
}