| 2175 | } |
| 2176 | |
| 2177 | void 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 | |
| 2212 | void S_WSellEnter() |
| 2213 | { |
no test coverage detected