From 72cfdc31ea8a47bd940362fa8f97a64437e99ad9 Mon Sep 17 00:00:00 2001 From: Andrew James Date: Tue, 19 Apr 2022 16:00:33 +1000 Subject: [PATCH] Clear held item when putting in an empty belt slot (#4490) --- Source/inv.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/inv.cpp b/Source/inv.cpp index 035c410f0..6758258c5 100644 --- a/Source/inv.cpp +++ b/Source/inv.cpp @@ -560,7 +560,8 @@ void CheckInvPaste(Player &player, Point cursorPosition) case ILOC_BELT: { int ii = r - SLOTXY_BELT_FIRST; if (player.SpdList[ii].isEmpty()) { - player.SpdList[ii] = player.HoldItem; + player.SpdList[ii] = std::move(player.HoldItem); + player.HoldItem.Clear(); } else { std::swap(player.SpdList[ii], player.HoldItem); if (player.HoldItem._itype == ItemType::Gold)