From 590a8c45c559e9b2f58b267ae3415496e4cf9cd9 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Thu, 16 Jan 2014 21:41:08 +0000 Subject: [PATCH] Really did what xoft wanted --- src/UI/SlotArea.cpp | 13 ++++++++----- 1 file 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) {