1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-12 16:58:39 +00:00

Fix overloading problems mentioned by clang

This commit is contained in:
Loic Blot 2016-10-30 16:12:09 +01:00 committed by Ner'zhul
parent 9d25242c5c
commit 595932a860
6 changed files with 40 additions and 35 deletions

View file

@ -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::setPitch(const float pitch, bool send_data)
void PlayerSAO::setYawAndSend(const float yaw)
{
setYaw(yaw);
((Server*)m_env->getGameDef())->SendMovePlayer(m_peer_id);
}
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);