diff --git a/src/server.cpp b/src/server.cpp index df7083b68..76345686a 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -3271,9 +3271,12 @@ bool Server::hudSetFlags(RemotePlayer *player, u32 flags, u32 mask) if (!player) return false; + u32 new_hud_flags = (player->hud_flags & ~mask) | flags; + if (new_hud_flags == player->hud_flags) // no change + return true; + SendHUDSetFlags(player->getPeerId(), flags, mask); - player->hud_flags &= ~mask; - player->hud_flags |= flags; + player->hud_flags = new_hud_flags; PlayerSAO* playersao = player->getPlayerSAO();