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

Function S_HBuyEnter

Source/stores.cpp:2476–2506  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2474}
2475
2476void S_HBuyEnter()
2477{
2478 int i, idx;
2479 BOOL done;
2480
2481 if (stextsel == 22) {
2482 StartStore(STORE_HEALER);
2483 stextsel = 16;
2484 } else {
2485 stextlhold = stextsel;
2486 stextvhold = stextsval;
2487 stextshold = STORE_HBUY;
2488 idx = stextsval + ((stextsel - stextup) >> 2);
2489 if (plr[myplr]._pGold < healitem[idx]._iIvalue) {
2490 StartStore(STORE_NOMONEY);
2491 } else {
2492 plr[myplr].HoldItem = healitem[idx];
2493 SetCursor_(plr[myplr].HoldItem._iCurs + CURSOR_FIRSTITEM);
2494 done = FALSE;
2495 i = 0;
2496 for (i = 0; i < 40 && !done; i++) {
2497 done = SpecialAutoPlace(myplr, i, cursW / 28, cursH / 28, FALSE);
2498 }
2499 if (done)
2500 StartStore(STORE_CONFIRM);
2501 else
2502 StartStore(STORE_NOROOM);
2503 SetCursor_(CURSOR_HAND);
2504 }
2505 }
2506}
2507
2508void S_StoryEnter()
2509{

Callers 1

STextEnterFunction · 0.85

Calls 3

StartStoreFunction · 0.85
SetCursor_Function · 0.85
SpecialAutoPlaceFunction · 0.85

Tested by

no test coverage detected