MCPcopy Create free account
hub / github.com/diasurgical/devilution / S_WBuyEnter

Function S_WBuyEnter

Source/stores.cpp:2177–2210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2175}
2176
2177void S_WBuyEnter()
2178{
2179 int i, idx;
2180 BOOL done;
2181
2182 if (stextsel == 22) {
2183 StartStore(STORE_WITCH);
2184 stextsel = 14;
2185 } else {
2186 stextlhold = stextsel;
2187 stextvhold = stextsval;
2188 stextshold = STORE_WBUY;
2189 idx = stextsval + ((stextsel - stextup) >> 2);
2190
2191 if (plr[myplr]._pGold < witchitem[idx]._iIvalue) {
2192 StartStore(STORE_NOMONEY);
2193 } else {
2194 plr[myplr].HoldItem = witchitem[idx];
2195 SetCursor_(plr[myplr].HoldItem._iCurs + CURSOR_FIRSTITEM);
2196 done = FALSE;
2197
2198 for (i = 0; i < 40 && !done; i++) {
2199 done = SpecialAutoPlace(myplr, i, cursW / 28, cursH / 28, FALSE);
2200 }
2201
2202 if (done)
2203 StartStore(STORE_CONFIRM);
2204 else
2205 StartStore(STORE_NOROOM);
2206
2207 SetCursor_(CURSOR_HAND);
2208 }
2209 }
2210}
2211
2212void S_WSellEnter()
2213{

Callers 1

STextEnterFunction · 0.85

Calls 3

StartStoreFunction · 0.85
SetCursor_Function · 0.85
SpecialAutoPlaceFunction · 0.85

Tested by

no test coverage detected