1
0
Fork 0

Don't send position update packet if player is dead

mutilcraft-mt53
ANAND 2019-05-04 13:03:51 +05:30 committed by SmallJoker
parent 3c395d908f
commit fb6f1fdcbe
1 changed files with 6 additions and 2 deletions

View File

@ -1244,8 +1244,12 @@ void Client::sendPlayerPos()
u8 camera_fov = map.getCameraFov(); u8 camera_fov = map.getCameraFov();
u8 wanted_range = map.getControl().wanted_range; u8 wanted_range = map.getControl().wanted_range;
// Save bandwidth by only updating position when something changed // Save bandwidth by only updating position when
if(myplayer->last_position == myplayer->getPosition() && // player is not dead and something changed
if (myplayer->isDead())
return;
if (myplayer->last_position == myplayer->getPosition() &&
myplayer->last_speed == myplayer->getSpeed() && myplayer->last_speed == myplayer->getSpeed() &&
myplayer->last_pitch == myplayer->getPitch() && myplayer->last_pitch == myplayer->getPitch() &&
myplayer->last_yaw == myplayer->getYaw() && myplayer->last_yaw == myplayer->getYaw() &&