diff options
Diffstat (limited to 'src/client/client.cpp')
-rw-r--r-- | src/client/client.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/client/client.cpp b/src/client/client.cpp index e3a790a56..d2330ecae 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -1290,7 +1290,7 @@ void Client::sendReady() Send(&pkt); } -void Client::sendPlayerPos() +void Client::sendPlayerPos(v3f pos) { LocalPlayer *player = m_env.getLocalPlayer(); if (!player) @@ -1308,7 +1308,7 @@ void Client::sendPlayerPos() // return; if ( - player->last_position == player->getPosition() && + player->last_position == pos && player->last_speed == player->getSpeed() && player->last_pitch == player->getPitch() && player->last_yaw == player->getYaw() && @@ -1317,7 +1317,7 @@ void Client::sendPlayerPos() player->last_wanted_range == wanted_range) return; - player->last_position = player->getPosition(); + player->last_position = pos; player->last_speed = player->getSpeed(); player->last_pitch = player->getPitch(); player->last_yaw = player->getYaw(); @@ -1332,6 +1332,14 @@ void Client::sendPlayerPos() Send(&pkt); } +void Client::sendPlayerPos() +{ + LocalPlayer *player = m_env.getLocalPlayer(); + if (!player) + return; + sendPlayerPos(player->getPosition()); +} + void Client::removeNode(v3s16 p) { std::map<v3s16, MapBlock*> modified_blocks; |