aboutsummaryrefslogtreecommitdiff
path: root/src/server.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server.cpp')
-rw-r--r--src/server.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/server.cpp b/src/server.cpp
index 40857f84d..920b9aa2d 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -4580,8 +4580,13 @@ bool Server::hudSetFlags(Player *player, u32 flags, u32 mask) {
SendHUDSetFlags(player->peer_id, flags, mask);
player->hud_flags = flags;
+
+ PlayerSAO* playersao = player->getPlayerSAO();
+
+ if (playersao == NULL)
+ return false;
- m_script->player_event(player->getPlayerSAO(),"hud_changed");
+ m_script->player_event(playersao, "hud_changed");
return true;
}