diff options
author | Loic Blot <loic.blot@unix-experience.fr> | 2016-10-30 16:12:09 +0100 |
---|---|---|
committer | Ner'zhul <nerzhul@users.noreply.github.com> | 2016-10-30 16:30:55 +0100 |
commit | 595932a8602292f28333ce14e20cee4b6d8820c1 (patch) | |
tree | 74969852c535f7100a30a7989cd49f1c5693f2ae /src/content_sao.cpp | |
parent | 9d25242c5c1411d692254cf910345d51c9a24fa3 (diff) | |
download | minetest-595932a8602292f28333ce14e20cee4b6d8820c1.tar.gz minetest-595932a8602292f28333ce14e20cee4b6d8820c1.tar.bz2 minetest-595932a8602292f28333ce14e20cee4b6d8820c1.zip |
Fix overloading problems mentioned by clang
Diffstat (limited to 'src/content_sao.cpp')
-rw-r--r-- | src/content_sao.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/content_sao.cpp b/src/content_sao.cpp index 23a064085..5fb8f936e 100644 --- a/src/content_sao.cpp +++ b/src/content_sao.cpp @@ -507,7 +507,7 @@ void LuaEntitySAO::rightClick(ServerActiveObject *clicker) m_env->getScriptIface()->luaentity_Rightclick(m_id, clicker); } -void LuaEntitySAO::setPos(v3f pos) +void LuaEntitySAO::setPos(const v3f &pos) { if(isAttached()) return; @@ -1078,27 +1078,32 @@ void PlayerSAO::moveTo(v3f pos, bool continuous) ((Server*)m_env->getGameDef())->SendMovePlayer(m_peer_id); } -void PlayerSAO::setYaw(const float yaw, bool send_data) +void PlayerSAO::setYaw(const float yaw) { if (m_player && yaw != m_yaw) m_player->setDirty(true); UnitSAO::setYaw(yaw); +} - // Datas should not be sent at player initialization - if (send_data) - ((Server*)m_env->getGameDef())->SendMovePlayer(m_peer_id); +void PlayerSAO::setYawAndSend(const float yaw) +{ + setYaw(yaw); + ((Server*)m_env->getGameDef())->SendMovePlayer(m_peer_id); } -void PlayerSAO::setPitch(const float pitch, bool send_data) +void PlayerSAO::setPitch(const float pitch) { if (m_player && pitch != m_pitch) m_player->setDirty(true); m_pitch = pitch; +} - if (send_data) - ((Server*)m_env->getGameDef())->SendMovePlayer(m_peer_id); +void PlayerSAO::setPitchAndSend(const float pitch) +{ + setPitch(pitch); + ((Server*)m_env->getGameDef())->SendMovePlayer(m_peer_id); } int PlayerSAO::punch(v3f dir, @@ -1173,13 +1178,8 @@ s16 PlayerSAO::readDamage() return damage; } -void PlayerSAO::setHP(s16 hp, bool direct) +void PlayerSAO::setHP(s16 hp) { - if (direct) { - m_hp = hp; - return; - } - s16 oldhp = m_hp; s16 hp_change = m_env->getScriptIface()->on_player_hpchange(this, hp - oldhp); |