summaryrefslogtreecommitdiffstats
path: root/src/UI/SlotArea.cpp
diff options
context:
space:
mode:
authorKingCol13 <kingsleydgs@gmail.com>2022-01-02 19:00:46 +0100
committerAlexander Harkness <me@bearbin.net>2022-01-13 01:39:12 +0100
commitf126e671f967bcb32d65d5ca25c7fd09f9d7722d (patch)
treee015204091bdd9f836057ba6ccd57494122817b1 /src/UI/SlotArea.cpp
parentReject non-fuels being placed in the furnace fuel slot. (diff)
downloadcuberite-f126e671f967bcb32d65d5ca25c7fd09f9d7722d.tar
cuberite-f126e671f967bcb32d65d5ca25c7fd09f9d7722d.tar.gz
cuberite-f126e671f967bcb32d65d5ca25c7fd09f9d7722d.tar.bz2
cuberite-f126e671f967bcb32d65d5ca25c7fd09f9d7722d.tar.lz
cuberite-f126e671f967bcb32d65d5ca25c7fd09f9d7722d.tar.xz
cuberite-f126e671f967bcb32d65d5ca25c7fd09f9d7722d.tar.zst
cuberite-f126e671f967bcb32d65d5ca25c7fd09f9d7722d.zip
Diffstat (limited to 'src/UI/SlotArea.cpp')
-rw-r--r--src/UI/SlotArea.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/UI/SlotArea.cpp b/src/UI/SlotArea.cpp
index 23850e3d6..948a32a95 100644
--- a/src/UI/SlotArea.cpp
+++ b/src/UI/SlotArea.cpp
@@ -1891,6 +1891,7 @@ void cSlotAreaFurnace::Clicked(cPlayer & a_Player, int a_SlotNum, eClickAction a
return;
}
+ // Result slot clicked
if (a_SlotNum == 2)
{
bool bAsync = false;
@@ -2001,13 +2002,16 @@ void cSlotAreaFurnace::Clicked(cPlayer & a_Player, int a_SlotNum, eClickAction a
return;
}
+ // Fuel slot clicked
if (a_SlotNum == 1)
{
cItem & DraggingItem = a_Player.GetDraggingItem();
cFurnaceRecipe * FurnaceRecipes = cRoot::Get()->GetFurnaceRecipe();
+
// Do not allow non-fuels to be placed in the fuel slot:
- if (!FurnaceRecipes->IsFuel(DraggingItem))
+ if (!DraggingItem.IsEmpty() && !FurnaceRecipes->IsFuel(DraggingItem) && (a_ClickAction != caShiftLeftClick) && (a_ClickAction != caShiftRightClick))
{
+ LOGD("Rejecting non fuel item being placed in fuel slot.");
return;
}
}