summaryrefslogtreecommitdiffstats
path: root/src/UI
diff options
context:
space:
mode:
authorHownaer <franzi.moos@googlemail.com>2014-08-28 14:58:03 +0200
committerHownaer <franzi.moos@googlemail.com>2014-08-28 14:58:03 +0200
commit6c3b80f04c7c2cca26efb57cc9827a7a1d20fcda (patch)
tree53ee50fb66b98dc4ac1e7d5d559273118226cce1 /src/UI
parentEnchanting table improvements. (diff)
downloadcuberite-6c3b80f04c7c2cca26efb57cc9827a7a1d20fcda.tar
cuberite-6c3b80f04c7c2cca26efb57cc9827a7a1d20fcda.tar.gz
cuberite-6c3b80f04c7c2cca26efb57cc9827a7a1d20fcda.tar.bz2
cuberite-6c3b80f04c7c2cca26efb57cc9827a7a1d20fcda.tar.lz
cuberite-6c3b80f04c7c2cca26efb57cc9827a7a1d20fcda.tar.xz
cuberite-6c3b80f04c7c2cca26efb57cc9827a7a1d20fcda.tar.zst
cuberite-6c3b80f04c7c2cca26efb57cc9827a7a1d20fcda.zip
Diffstat (limited to 'src/UI')
-rw-r--r--src/UI/SlotArea.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/UI/SlotArea.cpp b/src/UI/SlotArea.cpp
index 74173d087..88af257a0 100644
--- a/src/UI/SlotArea.cpp
+++ b/src/UI/SlotArea.cpp
@@ -1423,7 +1423,7 @@ void cSlotAreaEnchanting::Clicked(cPlayer & a_Player, int a_SlotNum, eClickActio
}
case caDblClick:
{
- // DblClicked(a_Player, a_SlotNum);
+ DblClicked(a_Player, a_SlotNum);
return;
}
case caMiddleClick:
@@ -1470,8 +1470,7 @@ void cSlotAreaEnchanting::Clicked(cPlayer & a_Player, int a_SlotNum, eClickActio
{
if (!Slot.IsEmpty())
{
- DraggingItem = Slot;
- Slot.Empty();
+ std::swap(DraggingItem, Slot);
}
}
else if (Slot.IsEmpty())
@@ -1487,9 +1486,7 @@ void cSlotAreaEnchanting::Clicked(cPlayer & a_Player, int a_SlotNum, eClickActio
else if ((DraggingItem.m_ItemCount == 1) && !DraggingItem.IsEqual(Slot))
{
// Switch contents
- cItem tmp(DraggingItem);
- DraggingItem = Slot;
- Slot = tmp;
+ std::swap(DraggingItem, Slot);
}
SetSlot(a_SlotNum, a_Player, Slot);