Skip to content
Permalink
Browse files

Don't send position update packet if player is dead

  • Loading branch information...
ClobberXD authored and SmallJoker committed May 4, 2019
1 parent 3c395d9 commit fb6f1fdcbe3ee2321cc33eb00f2c6da86744d00a
Showing with 6 additions and 2 deletions.
  1. +6 −2 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() &&

0 comments on commit fb6f1fd

Please sign in to comment.
You can’t perform that action at this time.