summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Pioch <lukas@zgow.de>2020-05-04 10:14:59 +0200
committerGitHub <noreply@github.com>2020-05-04 10:14:59 +0200
commite3de0aef64331deb5fdfb22c6e59236687d2857e (patch)
tree9bba4b74fe822385939c72b16acd8427951bb58b
parentAdd comment for boat position broadcast (diff)
downloadcuberite-e3de0aef64331deb5fdfb22c6e59236687d2857e.tar
cuberite-e3de0aef64331deb5fdfb22c6e59236687d2857e.tar.gz
cuberite-e3de0aef64331deb5fdfb22c6e59236687d2857e.tar.bz2
cuberite-e3de0aef64331deb5fdfb22c6e59236687d2857e.tar.lz
cuberite-e3de0aef64331deb5fdfb22c6e59236687d2857e.tar.xz
cuberite-e3de0aef64331deb5fdfb22c6e59236687d2857e.tar.zst
cuberite-e3de0aef64331deb5fdfb22c6e59236687d2857e.zip
Diffstat (limited to '')
-rw-r--r--src/ClientHandle.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp
index 43a9bc33e..4c59b47ce 100644
--- a/src/ClientHandle.cpp
+++ b/src/ClientHandle.cpp
@@ -1641,6 +1641,12 @@ void cClientHandle::HandleSlotSelected(Int16 a_SlotNum)
void cClientHandle::HandleSpectate(const cUUID & a_PlayerUUID)
{
+ if (!m_Player->IsGameModeSpectator())
+ {
+ Kick("Tried to use spectator mode when not in game mode spectator.");
+ return;
+ }
+
m_Player->GetWorld()->DoWithPlayerByUUID(a_PlayerUUID, [=](cPlayer & a_ToSpectate)
{
m_Player->TeleportToEntity(a_ToSpectate);