From abacbb485ce8cc98adfbce3ebdb233aabbf7ba34 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Thu, 11 Apr 2019 20:18:37 +0200 Subject: [PATCH] Clean up SwapItem --- Source/inv.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Source/inv.cpp b/Source/inv.cpp index ad439434c..1b7476e80 100644 --- a/Source/inv.cpp +++ b/Source/inv.cpp @@ -799,14 +799,13 @@ int WeaponAutoPlace(int pnum) int SwapItem(ItemStruct *a, ItemStruct *b) { - int v2; // eax - ItemStruct h; // [esp+8h] [ebp-170h] - - qmemcpy(&h, a, sizeof(h)); - v2 = h._iCurs; - qmemcpy(a, b, sizeof(ItemStruct)); - qmemcpy(b, &h, sizeof(ItemStruct)); - return v2 + CURSOR_FIRSTITEM; + ItemStruct h; + + h = *a; + *a = *b; + *b = h; + + return h._iCurs + CURSOR_FIRSTITEM; } void CheckInvPaste(int pnum, int mx, int my)