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.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/content_sao.cpp b/src/content_sao.cpp
index ad48f95fb..9dadcede9 100644
--- a/src/content_sao.cpp
+++ b/src/content_sao.cpp
@@ -29,6 +29,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "tool.h" // For ToolCapabilities
#include "gamedef.h"
#include "player.h"
+#include "server.h"
#include "scripting_game.h"
#include "genericobject.h"
#include "log.h"
@@ -716,7 +717,6 @@ PlayerSAO::PlayerSAO(ServerEnvironment *env_, Player *player_, u16 peer_id_,
m_attachment_parent_id(0),
m_attachment_sent(false),
// public
- m_moved(false),
m_physics_override_speed(1),
m_physics_override_jump(1),
m_physics_override_gravity(1),
@@ -867,7 +867,7 @@ void PlayerSAO::step(float dtime, bool send_recommended)
m_attachment_position = v3f(0,0,0);
m_attachment_rotation = v3f(0,0,0);
m_player->setPosition(m_last_good_position);
- m_moved = true;
+ ((Server*)m_env->getGameDef())->SendMovePlayer(m_peer_id);
}
//dstream<<"PlayerSAO::step: dtime: "<<dtime<<std::endl;
@@ -982,8 +982,7 @@ void PlayerSAO::setPos(v3f pos)
m_player->setPosition(pos);
// Movement caused by this command is always valid
m_last_good_position = pos;
- // Force position change on client
- m_moved = true;
+ ((Server*)m_env->getGameDef())->SendMovePlayer(m_peer_id);
}
void PlayerSAO::moveTo(v3f pos, bool continuous)
@@ -993,22 +992,19 @@ void PlayerSAO::moveTo(v3f pos, bool continuous)
m_player->setPosition(pos);
// Movement caused by this command is always valid
m_last_good_position = pos;
- // Force position change on client
- m_moved = true;
+ ((Server*)m_env->getGameDef())->SendMovePlayer(m_peer_id);
}
void PlayerSAO::setYaw(float yaw)
{
m_player->setYaw(yaw);
- // Force change on client
- m_moved = true;
+ ((Server*)m_env->getGameDef())->SendMovePlayer(m_peer_id);
}
void PlayerSAO::setPitch(float pitch)
{
m_player->setPitch(pitch);
- // Force change on client
- m_moved = true;
+ ((Server*)m_env->getGameDef())->SendMovePlayer(m_peer_id);
}
int PlayerSAO::punch(v3f dir,
@@ -1241,7 +1237,6 @@ bool PlayerSAO::checkMovementCheat()
<<" moved too fast; resetting position"
<<std::endl;
m_player->setPosition(m_last_good_position);
- m_moved = true;
cheated = true;
}
}