summaryrefslogtreecommitdiffstats
path: root/src/UI
diff options
context:
space:
mode:
Diffstat (limited to 'src/UI')
-rw-r--r--src/UI/SlotArea.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/UI/SlotArea.cpp b/src/UI/SlotArea.cpp
index bcbb06054..c8653a1e5 100644
--- a/src/UI/SlotArea.cpp
+++ b/src/UI/SlotArea.cpp
@@ -85,11 +85,11 @@ void cSlotArea::Clicked(cPlayer & a_Player, int a_SlotNum, eClickAction a_ClickA
{
if (DraggingItem.m_ItemType <= 0) // Empty-handed?
{
+ DraggingItem = Slot.CopyOne(); // Obtain copy of slot to preserve lore, enchantments, etc.
+
DraggingItem.m_ItemCount = (char)(((float)Slot.m_ItemCount) / 2.f + 0.5f);
Slot.m_ItemCount -= DraggingItem.m_ItemCount;
- DraggingItem.CustomCopy(Slot, true, false, true, true, true, true);
-
if (Slot.m_ItemCount <= 0)
{
Slot.Empty();
@@ -101,10 +101,13 @@ void cSlotArea::Clicked(cPlayer & a_Player, int a_SlotNum, eClickAction a_ClickA
cItemHandler * Handler = ItemHandler(Slot.m_ItemType);
if ((DraggingItem.m_ItemCount > 0) && (Slot.m_ItemCount < Handler->GetMaxStackSize()))
{
- Slot.m_ItemCount++;
- DraggingItem.m_ItemCount--;
+ char OldSlotCount = Slot.m_ItemCount;
- Slot.CustomCopy(DraggingItem, true, false, true, true, true, true);
+ Slot = DraggingItem.CopyOne(); // See above
+ OldSlotCount++;
+ Slot.m_ItemCount = OldSlotCount;
+
+ DraggingItem.m_ItemCount--;
}
if (DraggingItem.m_ItemCount <= 0)
{