From 2ea5104d4bf600ab902cff16ff2f8287fa51f9b8 Mon Sep 17 00:00:00 2001 From: Robin Eklind Date: Fri, 12 Apr 2019 00:03:39 +0900 Subject: [PATCH] S_StartSSell bin exact Using same trick as in #907 to remove qmemcpy. --- Source/stores.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Source/stores.cpp b/Source/stores.cpp index 256c83f05..d948516ab 100644 --- a/Source/stores.cpp +++ b/Source/stores.cpp @@ -869,11 +869,11 @@ void S_ScrollSSell(int idx) void S_StartSSell() { - int i; // eax - BOOLEAN sellok; // [esp+14h] [ebp-4h] + int i; + BOOL sellok; stextsize = 1; - sellok = 0; + sellok = FALSE; storenumh = 0; for (i = 0; i < 48; i++) @@ -881,8 +881,8 @@ void S_StartSSell() for (i = 0; i < plr[myplr]._pNumInv; i++) { if (SmithSellOk(i)) { - sellok = 1; - qmemcpy(&storehold[storenumh], &plr[myplr].InvList[i], sizeof(ItemStruct)); + sellok = TRUE; + storehold[storenumh] = plr[myplr].InvList[i]; if (storehold[storenumh]._iMagical != ITEM_QUALITY_NORMAL && storehold[storenumh]._iIdentified) storehold[storenumh]._ivalue = storehold[storenumh]._iIvalue; @@ -895,23 +895,23 @@ void S_StartSSell() } } - if (sellok) { - stextsmax = plr[myplr]._pNumInv; - stextscrl = 1; - stextsval = 0; - sprintf(tempstr, "Which item is for sale? Your gold : %i", plr[myplr]._pGold); + if (!sellok) { + stextscrl = 0; + sprintf(tempstr, "You have nothing I want. Your gold : %i", plr[myplr]._pGold); AddSText(0, 1, 1, tempstr, COL_GOLD, 0); AddSLine(3); AddSLine(21); - S_ScrollSSell(stextsval); AddSText(0, 22, 1, "Back", COL_WHITE, 1); OffsetSTextY(22, 6); } else { - stextscrl = 0; - sprintf(tempstr, "You have nothing I want. Your gold : %i", plr[myplr]._pGold); + stextsmax = plr[myplr]._pNumInv; + stextscrl = 1; + stextsval = 0; + sprintf(tempstr, "Which item is for sale? Your gold : %i", plr[myplr]._pGold); AddSText(0, 1, 1, tempstr, COL_GOLD, 0); AddSLine(3); AddSLine(21); + S_ScrollSSell(stextsval); AddSText(0, 22, 1, "Back", COL_WHITE, 1); OffsetSTextY(22, 6); }