Browse Source

Clean up S_BBuyEnter

pull/88/head
Anders Jenbo 7 years ago
parent
commit
a1e2e524f2
  1. 48
      Source/stores.cpp

48
Source/stores.cpp

@ -2947,51 +2947,33 @@ void HealerBuyItem()
void S_BBuyEnter() void S_BBuyEnter()
{ {
int v0; // ecx BOOL done;
int v1; // eax int i;
int v2; // ecx
int v3; // eax
int v4; // esi
if (stextsel == 10) { if (stextsel == 10) {
v0 = boyitem._iIvalue; stextlhold = 10;
stextvhold = stextsval; stextvhold = stextsval;
v1 = myplr;
stextshold = 13; stextshold = 13;
stextlhold = 10;
if (plr[myplr]._pGold >= boyitem._iIvalue + (boyitem._iIvalue >> 1)) { if (plr[myplr]._pGold >= boyitem._iIvalue + (boyitem._iIvalue >> 1)) {
qmemcpy(&plr[v1].HoldItem, &boyitem, sizeof(plr[v1].HoldItem)); StartStore(STORE_NOMONEY);
plr[v1].HoldItem._iIvalue += plr[v1].HoldItem._iIvalue >> 1; } else {
SetCursor_(plr[v1].HoldItem._iCurs + CURSOR_FIRSTITEM); plr[myplr].HoldItem = boyitem;
v3 = 0; plr[myplr].HoldItem._iIvalue += plr[myplr].HoldItem._iIvalue >> 1;
v4 = 0; SetCursor_(plr[myplr].HoldItem._iCurs + CURSOR_FIRSTITEM);
do { done = FALSE;
if (v3) for (i = 0; i < 40 && !done; i++) {
goto LABEL_8; done = AutoPlace(myplr, i, cursW / 28, cursH / 28, 0);
v3 = AutoPlace(myplr, v4++, cursW / 28, cursH / 28, 0);
} while (v4 < 40);
if (v3) {
LABEL_8:
_LOBYTE(v2) = STORE_CONFIRM;
goto LABEL_10;
} }
_LOBYTE(v2) = STORE_NOROOM; if (done)
LABEL_10: StartStore(STORE_CONFIRM);
StartStore(v2); else
StartStore(STORE_NOROOM);
SetCursor_(CURSOR_HAND); SetCursor_(CURSOR_HAND);
} else {
_LOBYTE(v0) = STORE_NOMONEY;
StartStore(v0);
} }
} else { } else {
stextflag = STORE_NONE; stextflag = STORE_NONE;
} }
} }
// 4B8C9C: using guessed type int cursH;
// 69F110: using guessed type int stextlhold;
// 6A8A24: using guessed type int stextvhold;
// 6A8A28: using guessed type int stextsel;
// 6AA705: using guessed type char stextflag;
void StoryIdItem() void StoryIdItem()
{ {

Loading…
Cancel
Save