From eda95f3ff42e5e50a09480175a049a964e466297 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Fri, 12 Apr 2019 01:02:33 +0200 Subject: [PATCH] Clean up WitchBuyItem --- Source/stores.cpp | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/Source/stores.cpp b/Source/stores.cpp index 9e6cf4bdc..3d90c6451 100644 --- a/Source/stores.cpp +++ b/Source/stores.cpp @@ -2737,9 +2737,7 @@ void S_WitchEnter() void WitchBuyItem() { - int idx; // ebx - ItemStruct *v3; // eax - ItemStruct *v4; // edi + int idx; idx = stextvhold + ((stextlhold - stextup) >> 2); @@ -2753,23 +2751,15 @@ void WitchBuyItem() if (idx == 19) { witchitem[19]._itype = -1; } else { - if (witchitem[idx + 1]._itype != -1) { - v3 = &witchitem[idx]; - do { - v4 = v3; - ++v3; - ++idx; - qmemcpy(v4, v3, sizeof(ItemStruct)); - } while (v3[1]._itype != -1); + for (; witchitem[idx + 1]._itype != -1; idx++) { + witchitem[idx] = witchitem[idx + 1]; } witchitem[idx]._itype = -1; } } - CalcPlrInv(myplr, 1u); + + CalcPlrInv(myplr, TRUE); } -// 69F108: using guessed type int stextup; -// 69F110: using guessed type int stextlhold; -// 6A8A24: using guessed type int stextvhold; void S_WBuyEnter() {