summaryrefslogtreecommitdiffstats
path: root/src/Entities
diff options
context:
space:
mode:
authortycho <work.tycho@gmail.com>2015-05-23 15:50:28 +0200
committertycho <work.tycho@gmail.com>2015-05-23 15:50:28 +0200
commitb29ae54d912a69f24946f8e1ff34448455d5afc3 (patch)
treeaeabb17db1922556466087cf6ebb7302d956f6c1 /src/Entities
parentFix tests (diff)
parentMerge pull request #2116 from mc-server/CMakeCacheOptions (diff)
downloadcuberite-b29ae54d912a69f24946f8e1ff34448455d5afc3.tar
cuberite-b29ae54d912a69f24946f8e1ff34448455d5afc3.tar.gz
cuberite-b29ae54d912a69f24946f8e1ff34448455d5afc3.tar.bz2
cuberite-b29ae54d912a69f24946f8e1ff34448455d5afc3.tar.lz
cuberite-b29ae54d912a69f24946f8e1ff34448455d5afc3.tar.xz
cuberite-b29ae54d912a69f24946f8e1ff34448455d5afc3.tar.zst
cuberite-b29ae54d912a69f24946f8e1ff34448455d5afc3.zip
Diffstat (limited to 'src/Entities')
-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 4ed5ef8a3..b5a48d9bf 100644
--- a/src/Entities/Player.cpp
+++ b/src/Entities/Player.cpp
@@ -1212,6 +1212,15 @@ void cPlayer::SetGameMode(eGameMode a_GameMode)
SetCanFly(false);
}
+ if (IsGameModeSpectator() && IsVisible())
+ {
+ SetVisible(false);
+ }
+ else if (!IsVisible())
+ {
+ SetVisible(true);
+ }
+
m_World->BroadcastPlayerListUpdateGameMode(*this);
}