aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorANAND <ClobberXD@gmail.com>2019-05-04 13:03:51 +0530
committerSmallJoker <mk939@ymail.com>2019-08-20 18:49:06 +0200
commitfb6f1fdcbe3ee2321cc33eb00f2c6da86744d00a (patch)
tree7f77e29cae99c97de58f85048175b5a4f8fafd8d /src
parent3c395d908f016158162f022f24d7ea48eeb7e8d5 (diff)
downloadminetest-fb6f1fdcbe3ee2321cc33eb00f2c6da86744d00a.tar.gz
minetest-fb6f1fdcbe3ee2321cc33eb00f2c6da86744d00a.tar.bz2
minetest-fb6f1fdcbe3ee2321cc33eb00f2c6da86744d00a.zip
Don't send position update packet if player is dead
Diffstat (limited to 'src')
-rw-r--r--src/client/client.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/client/client.cpp b/src/client/client.cpp
index e78b9bb8a..36d7fd251 100644
--- a/src/client/client.cpp
+++ b/src/client/client.cpp
@@ -1244,8 +1244,12 @@ void Client::sendPlayerPos()
u8 camera_fov = map.getCameraFov();
u8 wanted_range = map.getControl().wanted_range;
- // Save bandwidth by only updating position when something changed
- if(myplayer->last_position == myplayer->getPosition() &&
+ // Save bandwidth by only updating position when
+ // player is not dead and something changed
+ if (myplayer->isDead())
+ return;
+
+ if (myplayer->last_position == myplayer->getPosition() &&
myplayer->last_speed == myplayer->getSpeed() &&
myplayer->last_pitch == myplayer->getPitch() &&
myplayer->last_yaw == myplayer->getYaw() &&