diff options
author | daniel0916 <theschokolps@gmail.com> | 2014-04-14 11:48:12 +0200 |
---|---|---|
committer | daniel0916 <theschokolps@gmail.com> | 2014-04-14 11:48:12 +0200 |
commit | 856e900bf8e74cb478904d6322dcb6310ff7a3b2 (patch) | |
tree | ad793b40bdefc94e9fe9a59fe76333f4769869b7 /src/UI/SlotArea.cpp | |
parent | Fixed invisibility enchantments (diff) | |
download | cuberite-856e900bf8e74cb478904d6322dcb6310ff7a3b2.tar cuberite-856e900bf8e74cb478904d6322dcb6310ff7a3b2.tar.gz cuberite-856e900bf8e74cb478904d6322dcb6310ff7a3b2.tar.bz2 cuberite-856e900bf8e74cb478904d6322dcb6310ff7a3b2.tar.lz cuberite-856e900bf8e74cb478904d6322dcb6310ff7a3b2.tar.xz cuberite-856e900bf8e74cb478904d6322dcb6310ff7a3b2.tar.zst cuberite-856e900bf8e74cb478904d6322dcb6310ff7a3b2.zip |
Diffstat (limited to '')
-rw-r--r-- | src/UI/SlotArea.cpp | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/src/UI/SlotArea.cpp b/src/UI/SlotArea.cpp index 35230cffb..673c036b6 100644 --- a/src/UI/SlotArea.cpp +++ b/src/UI/SlotArea.cpp @@ -608,8 +608,21 @@ cSlotAreaTemporary(a_NumSlots, a_ParentWindow) +void cSlotAreaEnchanting::OnPlayerRemoved(cPlayer & a_Player) +{ + // Toss the item in the enchanting slot + TossItems(a_Player, 0, 1); + // Player not found - that is acceptable +} + + + + + void cSlotAreaEnchanting::Clicked(cPlayer & a_Player, int a_SlotNum, eClickAction a_ClickAction, const cItem & a_ClickedItem) { + super::Clicked(a_Player, a_SlotNum, a_ClickAction, a_ClickedItem); + // Check if Slot is in the Enchantment Table if (a_SlotNum == 0) { @@ -621,20 +634,7 @@ void cSlotAreaEnchanting::Clicked(cPlayer & a_Player, int a_SlotNum, eClickActio { ClickedResult(a_Player); } - return; } - super::Clicked(a_Player, a_SlotNum, a_ClickAction, a_ClickedItem); -} - - - - - -void cSlotAreaEnchanting::OnPlayerRemoved(cPlayer & a_Player) -{ - // Toss the item in the enchanting slot - TossItems(a_Player, 0, 0); - // Player not found - that is acceptable } @@ -643,13 +643,15 @@ void cSlotAreaEnchanting::OnPlayerRemoved(cPlayer & a_Player) void cSlotAreaEnchanting::ClickedResult(cPlayer & a_Player) { - if (a_Player.GetDraggingItem().IsEmpty()) + cItem Item = *GetSlot(0, a_Player); + + if (Item.IsEmpty()) { m_ParentWindow.SetProperty(0, 0, a_Player); m_ParentWindow.SetProperty(1, 0, a_Player); m_ParentWindow.SetProperty(2, 0, a_Player); } - else if (cItem::IsEnchantable(a_Player.GetDraggingItem().m_ItemType)) + else if (cItem::IsEnchantable(Item.m_ItemType)) { int PosX = 0; int PosY = 0; |