From cb640ffea4a51a10db2e379ada8dc0487378ba09 Mon Sep 17 00:00:00 2001 From: bibo38 Date: Wed, 12 Oct 2016 14:38:45 +0200 Subject: Spectators added (#2852) --- src/UI/SlotArea.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/UI/SlotArea.cpp') diff --git a/src/UI/SlotArea.cpp b/src/UI/SlotArea.cpp index 2cef9b06d..8878bb900 100644 --- a/src/UI/SlotArea.cpp +++ b/src/UI/SlotArea.cpp @@ -58,6 +58,14 @@ void cSlotArea::Clicked(cPlayer & a_Player, int a_SlotNum, eClickAction a_ClickA return; } + if (a_Player.IsGameModeSpectator()) + { + // Block the action of the player and make sure, the inventory doesn't get out of sync + a_Player.GetClientHandle()->SendInventorySlot(-1, -1, cItem()); // Reset the dragged item + SetSlot(a_SlotNum, a_Player, *GetSlot(a_SlotNum, a_Player)); // Update the current slot + return; + } + switch (a_ClickAction) { case caShiftLeftClick: -- cgit v1.2.3