From 6b286941f3afbc0da8f2d2131fa44d7aadb77f12 Mon Sep 17 00:00:00 2001 From: qndel Date: Wed, 2 Oct 2019 22:03:14 +0200 Subject: [PATCH] enums --- Source/debug.cpp | 4 ++-- Source/drlg_l2.cpp | 8 ++++---- Source/drlg_l3.cpp | 8 ++++---- Source/inv.cpp | 2 +- Source/items.cpp | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Source/debug.cpp b/Source/debug.cpp index 2c89ba600..ae843bb30 100644 --- a/Source/debug.cpp +++ b/Source/debug.cpp @@ -97,7 +97,7 @@ void GiveGoldCheat() { int i, ni; - for (i = 0; i < 40; i++) { + for (i = 0; i < NUM_INV_GRID_ELEM; i++) { if (!plr[myplr].InvGrid[i]) { ni = plr[myplr]._pNumInv++; SetPlrHandItem(&plr[myplr].InvList[ni], IDI_GOLD); @@ -132,7 +132,7 @@ void TakeGoldCheat() int i; char ig; - for (i = 0; i < 40; i++) { + for (i = 0; i < NUM_INV_GRID_ELEM; i++) { ig = plr[myplr].InvGrid[i]; if (ig > 0 && plr[myplr].InvList[ig - 1]._itype == ITYPE_GOLD) RemoveInvItem(myplr, ig - 1); diff --git a/Source/drlg_l2.cpp b/Source/drlg_l2.cpp index 91340a2d3..20f2accd9 100644 --- a/Source/drlg_l2.cpp +++ b/Source/drlg_l2.cpp @@ -2118,8 +2118,8 @@ void DRLG_InitL2Vals() { int i, j, pc; - for (j = 0; j < 112; j++) { - for (i = 0; i < 112; i++) { + for (j = 0; j < MAXDUNY; j++) { + for (i = 0; i < MAXDUNX; i++) { if (dPiece[i][j] == 541) { pc = 5; } else if (dPiece[i][j] == 178) { @@ -2140,8 +2140,8 @@ void DRLG_InitL2Vals() dArch[i][j] = pc; } } - for (j = 0; j < 112; j++) { - for (i = 0; i < 112; i++) { + for (j = 0; j < MAXDUNY; j++) { + for (i = 0; i < MAXDUNX; i++) { if (dPiece[i][j] == 132) { dArch[i][j + 1] = 2; dArch[i][j + 2] = 1; diff --git a/Source/drlg_l3.cpp b/Source/drlg_l3.cpp index 12cd04e3d..2b4e1d6e9 100644 --- a/Source/drlg_l3.cpp +++ b/Source/drlg_l3.cpp @@ -302,8 +302,8 @@ void CreateL3Dungeon(DWORD rseed, int entry) DRLG_L3(entry); DRLG_L3Pass3(); - for (j = 0; j < 112; j++) { - for (i = 0; i < 112; i++) { + for (j = 0; j < MAXDUNY; j++) { + for (i = 0; i < MAXDUNX; i++) { if (dPiece[i][j] >= 56 && dPiece[i][j] <= 147) { DoLighting(i, j, 7, -1); } else if (dPiece[i][j] >= 154 && dPiece[i][j] <= 161) { @@ -1778,8 +1778,8 @@ void LoadL3Dungeon(char *sFileName, int vx, int vy) SetMapMonsters(pLevelMap, 0, 0); SetMapObjects(pLevelMap, 0, 0); - for (j = 0; j < 112; j++) { - for (i = 0; i < 112; i++) { + for (j = 0; j < MAXDUNY; j++) { + for (i = 0; i < MAXDUNX; i++) { if (dPiece[i][j] >= 56 && dPiece[i][j] <= 147) { DoLighting(i, j, 7, -1); } else if (dPiece[i][j] >= 154 && dPiece[i][j] <= 161) { diff --git a/Source/inv.cpp b/Source/inv.cpp index c03aa3011..58a48d093 100644 --- a/Source/inv.cpp +++ b/Source/inv.cpp @@ -169,7 +169,7 @@ void InvDrawSlotBack(int X, int Y, int W, int H) void DrawInv() { - BOOL invtest[40]; + BOOL invtest[NUM_INV_GRID_ELEM]; int frame, frame_width, colour, screen_x, screen_y, i, j, ii; CelDecodeOnly(384, 511, pInvCels, 1, 320); diff --git a/Source/items.cpp b/Source/items.cpp index ed9093c96..c69673faf 100644 --- a/Source/items.cpp +++ b/Source/items.cpp @@ -944,7 +944,7 @@ void CreatePlrItems(int p) plr[p].HoldItem._ivalue = GOLD_MAX_LIMIT; plr[p].HoldItem._iCurs = ICURS_GOLD_LARGE; plr[p]._pGold = plr[p].HoldItem._ivalue * 40; - for (i = 0; i < 40; i++) { + for (i = 0; i < NUM_INV_GRID_ELEM; i++) { GetPlrHandSeed(&plr[p].HoldItem); plr[p].InvList[plr[p]._pNumInv++] = plr[p].HoldItem; plr[p].InvGrid[i] = plr[p]._pNumInv;