summaryrefslogtreecommitdiffstats
path: root/src/UI
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-07-01 14:47:49 +0200
committerHowaner <franzi.moos@googlemail.com>2014-07-01 14:47:49 +0200
commit64f6ddf1e2171dd7713f454c792916257e770f98 (patch)
tree70e0a745a13bd11f445b546374df8d50768d8f81 /src/UI
parentMerge pull request #1140 from mc-server/FixMingw (diff)
downloadcuberite-64f6ddf1e2171dd7713f454c792916257e770f98.tar
cuberite-64f6ddf1e2171dd7713f454c792916257e770f98.tar.gz
cuberite-64f6ddf1e2171dd7713f454c792916257e770f98.tar.bz2
cuberite-64f6ddf1e2171dd7713f454c792916257e770f98.tar.lz
cuberite-64f6ddf1e2171dd7713f454c792916257e770f98.tar.xz
cuberite-64f6ddf1e2171dd7713f454c792916257e770f98.tar.zst
cuberite-64f6ddf1e2171dd7713f454c792916257e770f98.zip
Diffstat (limited to 'src/UI')
-rw-r--r--src/UI/Window.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/UI/Window.cpp b/src/UI/Window.cpp
index 98a9a0cec..af3e3e45c 100644
--- a/src/UI/Window.cpp
+++ b/src/UI/Window.cpp
@@ -170,7 +170,13 @@ void cWindow::Clicked(
const cItem & a_ClickedItem
)
{
- cPluginManager * PlgMgr = cRoot::Get()->GetPluginManager();
+ if (!IsValidItem(a_ClickedItem.m_ItemType) && !IsValidBlock(a_ClickedItem.m_ItemType))
+ {
+ LOGWARNING("%s: Player \"%s\" clicked to a non-existing item; ignoring click.", __FUNCTION__, a_Player.GetName().c_str());
+ return;
+ }
+
+ cPluginManager * PlgMgr = cRoot::Get()->GetPluginManager();
if (a_WindowID != m_WindowID)
{
LOGWARNING("%s: Wrong window ID (exp %d, got %d) received from \"%s\"; ignoring click.", __FUNCTION__, m_WindowID, a_WindowID, a_Player.GetName().c_str());