mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 01:53:45 +01:00
Send HUD flags only if changed
This commit is contained in:
parent
be05c9022d
commit
b9ee29a945
@ -3271,9 +3271,12 @@ bool Server::hudSetFlags(RemotePlayer *player, u32 flags, u32 mask)
|
|||||||
if (!player)
|
if (!player)
|
||||||
return false;
|
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);
|
SendHUDSetFlags(player->getPeerId(), flags, mask);
|
||||||
player->hud_flags &= ~mask;
|
player->hud_flags = new_hud_flags;
|
||||||
player->hud_flags |= flags;
|
|
||||||
|
|
||||||
PlayerSAO* playersao = player->getPlayerSAO();
|
PlayerSAO* playersao = player->getPlayerSAO();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user