From: ANAND Date: Sat, 4 May 2019 07:33:51 +0000 (+0530) Subject: Don't send position update packet if player is dead X-Git-Tag: 5.1.0~91 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=fb6f1fdcbe3ee2321cc33eb00f2c6da86744d00a;p=oweals%2Fminetest.git Don't send position update packet if player is dead --- 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() &&