| 1864 | } |
| 1865 | |
| 1866 | void S_SBuyEnter() |
| 1867 | { |
| 1868 | int idx, i; |
| 1869 | BOOL done; |
| 1870 | |
| 1871 | if (stextsel == 22) { |
| 1872 | StartStore(STORE_SMITH); |
| 1873 | stextsel = 12; |
| 1874 | } else { |
| 1875 | stextlhold = stextsel; |
| 1876 | stextvhold = stextsval; |
| 1877 | stextshold = STORE_SBUY; |
| 1878 | idx = stextsval + ((stextsel - stextup) >> 2); |
| 1879 | if (plr[myplr]._pGold < smithitem[idx]._iIvalue) { |
| 1880 | StartStore(STORE_NOMONEY); |
| 1881 | } else { |
| 1882 | plr[myplr].HoldItem = smithitem[idx]; |
| 1883 | SetCursor_(plr[myplr].HoldItem._iCurs + CURSOR_FIRSTITEM); |
| 1884 | done = FALSE; |
| 1885 | |
| 1886 | for (i = 0; i < 40 && !done; i++) { |
| 1887 | done = AutoPlace(myplr, i, cursW / 28, cursH / 28, FALSE); |
| 1888 | } |
| 1889 | if (done) |
| 1890 | StartStore(STORE_CONFIRM); |
| 1891 | else |
| 1892 | StartStore(STORE_NOROOM); |
| 1893 | SetCursor_(CURSOR_HAND); |
| 1894 | } |
| 1895 | } |
| 1896 | } |
| 1897 | |
| 1898 | void SmithBuyPItem() |
| 1899 | { |
no test coverage detected