aboutsummaryrefslogtreecommitdiff
path: root/src/content_sao.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/content_sao.cpp')
-rw-r--r--src/content_sao.cpp28
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);