Really did what xoft wanted
This commit is contained in:
parent
7eb3cabd19
commit
590a8c45c5
@ -85,11 +85,11 @@ void cSlotArea::Clicked(cPlayer & a_Player, int a_SlotNum, eClickAction a_ClickA
|
|||||||
{
|
{
|
||||||
if (DraggingItem.m_ItemType <= 0) // Empty-handed?
|
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);
|
DraggingItem.m_ItemCount = (char)(((float)Slot.m_ItemCount) / 2.f + 0.5f);
|
||||||
Slot.m_ItemCount -= DraggingItem.m_ItemCount;
|
Slot.m_ItemCount -= DraggingItem.m_ItemCount;
|
||||||
|
|
||||||
DraggingItem.CustomCopy(Slot, true, false, true, true, true, true);
|
|
||||||
|
|
||||||
if (Slot.m_ItemCount <= 0)
|
if (Slot.m_ItemCount <= 0)
|
||||||
{
|
{
|
||||||
Slot.Empty();
|
Slot.Empty();
|
||||||
@ -101,10 +101,13 @@ void cSlotArea::Clicked(cPlayer & a_Player, int a_SlotNum, eClickAction a_ClickA
|
|||||||
cItemHandler * Handler = ItemHandler(Slot.m_ItemType);
|
cItemHandler * Handler = ItemHandler(Slot.m_ItemType);
|
||||||
if ((DraggingItem.m_ItemCount > 0) && (Slot.m_ItemCount < Handler->GetMaxStackSize()))
|
if ((DraggingItem.m_ItemCount > 0) && (Slot.m_ItemCount < Handler->GetMaxStackSize()))
|
||||||
{
|
{
|
||||||
Slot.m_ItemCount++;
|
char OldSlotCount = Slot.m_ItemCount;
|
||||||
DraggingItem.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)
|
if (DraggingItem.m_ItemCount <= 0)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user