diff options
author | Elias Fleckenstein <eliasfleckenstein@web.de> | 2020-07-20 16:43:11 +0200 |
---|---|---|
committer | Elias Fleckenstein <eliasfleckenstein@web.de> | 2020-07-20 16:43:11 +0200 |
commit | 064c25caa14f2e7564992c21f27de753985062e1 (patch) | |
tree | 7274eb58aefe32523da264c2c7f568dde944226b /src/client/client.cpp | |
parent | 5a8610c2f41e44c827912246b4f9437051d11621 (diff) | |
download | dragonfireclient-064c25caa14f2e7564992c21f27de753985062e1.tar.xz |
Added EntitySpeed
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; |