summaryrefslogtreecommitdiffstats
path: root/src/Entities/Player.cpp
diff options
context:
space:
mode:
authorAlexander Harkness <me@bearbin.net>2015-05-23 12:56:39 +0200
committerAlexander Harkness <me@bearbin.net>2015-05-23 12:56:39 +0200
commit3a27fabbab7096c3ba9ab6dbf2aee3d7096a0457 (patch)
tree1bc0d72444fdd764230efa33ca50e9e5022d94d5 /src/Entities/Player.cpp
parentMerge pull request #2110 from mc-server/coverity-fix (diff)
parentFixed players head visible when in spectator mode (diff)
downloadcuberite-3a27fabbab7096c3ba9ab6dbf2aee3d7096a0457.tar
cuberite-3a27fabbab7096c3ba9ab6dbf2aee3d7096a0457.tar.gz
cuberite-3a27fabbab7096c3ba9ab6dbf2aee3d7096a0457.tar.bz2
cuberite-3a27fabbab7096c3ba9ab6dbf2aee3d7096a0457.tar.lz
cuberite-3a27fabbab7096c3ba9ab6dbf2aee3d7096a0457.tar.xz
cuberite-3a27fabbab7096c3ba9ab6dbf2aee3d7096a0457.tar.zst
cuberite-3a27fabbab7096c3ba9ab6dbf2aee3d7096a0457.zip
Diffstat (limited to 'src/Entities/Player.cpp')
-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);
}