summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorb33duck <b33duck@gmail.com>2015-05-22 21:25:16 +0200
committerb33duck <b33duck@gmail.com>2015-05-22 21:25:16 +0200
commit906288c6eb007c7cd71ada3b5793fb373d722484 (patch)
tree4919125a14ebea4c0b65e7a94eb871612d43e1ea /src
parentAdded beeduck to contributors (diff)
downloadcuberite-906288c6eb007c7cd71ada3b5793fb373d722484.tar
cuberite-906288c6eb007c7cd71ada3b5793fb373d722484.tar.gz
cuberite-906288c6eb007c7cd71ada3b5793fb373d722484.tar.bz2
cuberite-906288c6eb007c7cd71ada3b5793fb373d722484.tar.lz
cuberite-906288c6eb007c7cd71ada3b5793fb373d722484.tar.xz
cuberite-906288c6eb007c7cd71ada3b5793fb373d722484.tar.zst
cuberite-906288c6eb007c7cd71ada3b5793fb373d722484.zip
Diffstat (limited to '')
-rw-r--r--src/Entities/Player.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp
index 607a663de..1dab952c5 100644
--- a/src/Entities/Player.cpp
+++ b/src/Entities/Player.cpp
@@ -1205,6 +1205,15 @@ void cPlayer::SetGameMode(eGameMode a_GameMode)
SetCanFly(false);
}
+ if (IsGameModeSpectator() && IsVisible())
+ {
+ SetVisible(false);
+ }
+ else if (!IsVisible())
+ {
+ SetVisible(true);
+ }
+
m_World->BroadcastPlayerListUpdateGameMode(*this);
}