Browse Source

minor cleanup

pull/944/head
qndel 5 years ago committed by Anders Jenbo
parent
commit
73dce4fa39
  1. 2
      Source/debug.cpp
  2. 4
      Source/inv.cpp
  3. 2
      Source/objects.cpp
  4. 6
      Source/stores.cpp

2
Source/debug.cpp

@ -104,7 +104,7 @@ void GiveGoldCheat()
int i, ni;
for (i = 0; i < NUM_INV_GRID_ELEM; i++) {
if (!plr[myplr].InvGrid[i]) {
if (plr[myplr].InvGrid[i] == 0) {
ni = plr[myplr]._pNumInv++;
SetPlrHandItem(&plr[myplr].InvList[ni], IDI_GOLD);
GetPlrHandSeed(&plr[myplr].InvList[ni]);

4
Source/inv.cpp

@ -900,7 +900,7 @@ BOOL GoldAutoPlace(int pnum)
for (i = 39; i >= 0 && !done; i--) {
yy = 10 * (i / 10);
xx = i % 10;
if (!plr[pnum].InvGrid[xx + yy]) {
if (plr[pnum].InvGrid[xx + yy] == 0) {
ii = plr[pnum]._pNumInv;
plr[pnum].InvList[ii] = plr[pnum].HoldItem;
plr[pnum]._pNumInv = plr[pnum]._pNumInv + 1;
@ -963,7 +963,7 @@ BOOL GoldAutoPlace(int pnum)
for (int i = 39; i >= 0 && !done; i--) {
yy = 10 * (i / 10);
xx = i % 10;
if (!plr[pnum].InvGrid[xx + yy]) {
if (plr[pnum].InvGrid[xx + yy] == 0) {
ii = plr[pnum]._pNumInv;
plr[pnum].InvList[ii] = plr[pnum].HoldItem;
plr[pnum]._pNumInv = plr[pnum]._pNumInv + 1;

2
Source/objects.cpp

@ -3950,7 +3950,7 @@ void OperateShrine(int pnum, int i, int sType)
if (pnum != myplr)
return;
for (j = 0; j < NUM_INV_GRID_ELEM; j++) {
if (!plr[pnum].InvGrid[j]) {
if (plr[pnum].InvGrid[j] == 0) {
r = 5 * leveltype + random_(160, 10 * leveltype);
t = plr[pnum]._pNumInv; // check
plr[pnum].InvList[t] = golditem;

6
Source/stores.cpp

@ -2083,7 +2083,7 @@ BOOL StoreGoldFit(int idx)
cost = storehold[idx]._iIvalue;
sz = cost / GOLD_MAX_LIMIT;
if (cost % GOLD_MAX_LIMIT)
if (cost % GOLD_MAX_LIMIT != 0)
sz++;
SetCursor_(storehold[idx]._iCurs + CURSOR_FIRSTITEM);
@ -2094,7 +2094,7 @@ BOOL StoreGoldFit(int idx)
return TRUE;
for (i = 0; i < NUM_INV_GRID_ELEM; i++) {
if (!plr[myplr].InvGrid[i])
if (plr[myplr].InvGrid[i] == 0)
numsqrs++;
}
@ -2124,7 +2124,7 @@ void PlaceStoreGold(int v)
for (i = 0; i < NUM_INV_GRID_ELEM && !done; i++) {
yy = 10 * (i / 10);
xx = i % 10;
if (!plr[myplr].InvGrid[xx + yy]) {
if (plr[myplr].InvGrid[xx + yy] == 0) {
ii = plr[myplr]._pNumInv;
GetGoldSeed(myplr, &golditem);
plr[myplr].InvList[ii] = golditem;

Loading…
Cancel
Save