Update HUD flags on server like on client
authorest31 <MTest31@outlook.com>
Sun, 22 Nov 2015 15:15:47 +0000 (16:15 +0100)
committerest31 <MTest31@outlook.com>
Sun, 22 Nov 2015 15:49:20 +0000 (16:49 +0100)
Fixes bug for which commit

6c37e89f08f962eaba788a31f5d3c798ceaa65e6 "Fix old client showing duplicated health bar on new server"
by @sapier

laid the groundwork, where the server has
updated its copy of the hud flags without
respecting the mask.

Fixes #3395.

src/server.cpp

index f6faccb1f2f455287577e3b4c4a2dd2043def6a2..86096055d1f5e9fd1114dc69686522f81be31b53 100644 (file)
@@ -3034,7 +3034,8 @@ bool Server::hudSetFlags(Player *player, u32 flags, u32 mask)
                return false;
 
        SendHUDSetFlags(player->peer_id, flags, mask);
-       player->hud_flags = flags;
+       player->hud_flags &= ~mask;
+       player->hud_flags |= flags;
 
        PlayerSAO* playersao = player->getPlayerSAO();