Browse Source

S_StartSSell bin exact

Using same trick as in #907 to remove qmemcpy.
pull/88/head
Robin Eklind 7 years ago committed by Anders Jenbo
parent
commit
2ea5104d4b
  1. 26
      Source/stores.cpp

26
Source/stores.cpp

@ -869,11 +869,11 @@ void S_ScrollSSell(int idx)
void S_StartSSell() void S_StartSSell()
{ {
int i; // eax int i;
BOOLEAN sellok; // [esp+14h] [ebp-4h] BOOL sellok;
stextsize = 1; stextsize = 1;
sellok = 0; sellok = FALSE;
storenumh = 0; storenumh = 0;
for (i = 0; i < 48; i++) for (i = 0; i < 48; i++)
@ -881,8 +881,8 @@ void S_StartSSell()
for (i = 0; i < plr[myplr]._pNumInv; i++) { for (i = 0; i < plr[myplr]._pNumInv; i++) {
if (SmithSellOk(i)) { if (SmithSellOk(i)) {
sellok = 1; sellok = TRUE;
qmemcpy(&storehold[storenumh], &plr[myplr].InvList[i], sizeof(ItemStruct)); storehold[storenumh] = plr[myplr].InvList[i];
if (storehold[storenumh]._iMagical != ITEM_QUALITY_NORMAL && storehold[storenumh]._iIdentified) if (storehold[storenumh]._iMagical != ITEM_QUALITY_NORMAL && storehold[storenumh]._iIdentified)
storehold[storenumh]._ivalue = storehold[storenumh]._iIvalue; storehold[storenumh]._ivalue = storehold[storenumh]._iIvalue;
@ -895,23 +895,23 @@ void S_StartSSell()
} }
} }
if (sellok) { if (!sellok) {
stextsmax = plr[myplr]._pNumInv; stextscrl = 0;
stextscrl = 1; sprintf(tempstr, "You have nothing I want. Your gold : %i", plr[myplr]._pGold);
stextsval = 0;
sprintf(tempstr, "Which item is for sale? Your gold : %i", plr[myplr]._pGold);
AddSText(0, 1, 1, tempstr, COL_GOLD, 0); AddSText(0, 1, 1, tempstr, COL_GOLD, 0);
AddSLine(3); AddSLine(3);
AddSLine(21); AddSLine(21);
S_ScrollSSell(stextsval);
AddSText(0, 22, 1, "Back", COL_WHITE, 1); AddSText(0, 22, 1, "Back", COL_WHITE, 1);
OffsetSTextY(22, 6); OffsetSTextY(22, 6);
} else { } else {
stextscrl = 0; stextsmax = plr[myplr]._pNumInv;
sprintf(tempstr, "You have nothing I want. Your gold : %i", plr[myplr]._pGold); 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); AddSText(0, 1, 1, tempstr, COL_GOLD, 0);
AddSLine(3); AddSLine(3);
AddSLine(21); AddSLine(21);
S_ScrollSSell(stextsval);
AddSText(0, 22, 1, "Back", COL_WHITE, 1); AddSText(0, 22, 1, "Back", COL_WHITE, 1);
OffsetSTextY(22, 6); OffsetSTextY(22, 6);
} }

Loading…
Cancel
Save