From efa445731ae91a2aee924664a03425f5c20860a0 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sun, 27 Sep 2020 04:21:49 +0200 Subject: [PATCH 1/9] Apply NUM_XY_SLOTS --- Source/inv.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/inv.cpp b/Source/inv.cpp index c1db7c51e..e0bc3dea5 100644 --- a/Source/inv.cpp +++ b/Source/inv.cpp @@ -718,7 +718,7 @@ void CheckInvPaste(int pnum, int mx, int my) sx = icursW28; sy = icursH28; done = FALSE; - for (r = 0; r < sizeof(InvRect) / sizeof(InvRect[0]) && !done; r++) { + for (r = 0; r < NUM_XY_SLOTS && !done; r++) { if (i >= InvRect[r].X && i < InvRect[r].X + INV_SLOT_SIZE_PX) { if (j >= InvRect[r].Y - INV_SLOT_SIZE_PX - 1 && j < InvRect[r].Y) { done = TRUE; @@ -1952,7 +1952,7 @@ char CheckInvHLight() PlayerStruct *p; char rv; - for (r = 0; (DWORD)r < 73; r++) { + for (r = 0; (DWORD)r < NUM_XY_SLOTS; r++) { if (MouseX >= InvRect[r].X && MouseX < InvRect[r].X + 29 && MouseY >= InvRect[r].Y - 29 From 145ab3c48ef1b00f79c88a634f33d96f6029eada Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sun, 27 Sep 2020 04:25:46 +0200 Subject: [PATCH 2/9] Apply more defines to replace magic numbers --- Source/inv.cpp | 4 ++-- Source/plrmsg.cpp | 8 ++++---- Source/render.cpp | 6 +++--- Source/render.h | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Source/inv.cpp b/Source/inv.cpp index e0bc3dea5..ae91ae1a8 100644 --- a/Source/inv.cpp +++ b/Source/inv.cpp @@ -718,7 +718,7 @@ void CheckInvPaste(int pnum, int mx, int my) sx = icursW28; sy = icursH28; done = FALSE; - for (r = 0; r < NUM_XY_SLOTS && !done; r++) { + for (r = 0; (DWORD)r < NUM_XY_SLOTS && !done; r++) { if (i >= InvRect[r].X && i < InvRect[r].X + INV_SLOT_SIZE_PX) { if (j >= InvRect[r].Y - INV_SLOT_SIZE_PX - 1 && j < InvRect[r].Y) { done = TRUE; @@ -1961,7 +1961,7 @@ char CheckInvHLight() } } - if ((DWORD)r >= 73) + if ((DWORD)r >= NUM_XY_SLOTS) return -1; rv = -1; diff --git a/Source/plrmsg.cpp b/Source/plrmsg.cpp index dfb69e728..a88f9b343 100644 --- a/Source/plrmsg.cpp +++ b/Source/plrmsg.cpp @@ -89,16 +89,16 @@ void DrawPlrMsg() int i; DWORD x = 10 + SCREEN_X; DWORD y = 70 + SCREEN_Y; - DWORD width = 620; + DWORD width = SCREEN_WIDTH - 20; _plrmsg *pMsg; if (chrflag || questlog) { if (invflag || sbookflag) return; - x = 330 + SCREEN_X; - width = 300; + x += SPANEL_WIDTH; + width -= SPANEL_WIDTH; } else if (invflag || sbookflag) - width = 300; + width -= SPANEL_WIDTH; pMsg = plr_msgs; for (i = 0; i < 8; i++) { diff --git a/Source/render.cpp b/Source/render.cpp index b87c0416c..eab646500 100644 --- a/Source/render.cpp +++ b/Source/render.cpp @@ -14,7 +14,7 @@ DWORD *gpDrawMask = NULL; // char world_4B326D[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; /** Specifies the draw masks used to render transparency of the right side of tiles. */ -DWORD RightMask[32] = { +DWORD RightMask[TILE_WIDTH] = { 0xEAAAAAAA, 0xF5555555, 0xFEAAAAAA, 0xFF555555, 0xFFEAAAAA, 0xFFF55555, @@ -33,7 +33,7 @@ DWORD RightMask[32] = { 0xFFFFFFFF, 0xFFFFFFFF }; /** Specifies the draw masks used to render transparency of the left side of tiles. */ -DWORD LeftMask[32] = { +DWORD LeftMask[TILE_WIDTH] = { 0xAAAAAAAB, 0x5555555F, 0xAAAAAABF, 0x555555FF, 0xAAAAABFF, 0x55555FFF, @@ -52,7 +52,7 @@ DWORD LeftMask[32] = { 0xFFFFFFFF, 0xFFFFFFFF }; /** Specifies the draw masks used to render transparency of wall tiles. */ -DWORD WallMask[32] = { +DWORD WallMask[TILE_WIDTH] = { 0xAAAAAAAA, 0x55555555, 0xAAAAAAAA, 0x55555555, 0xAAAAAAAA, 0x55555555, diff --git a/Source/render.h b/Source/render.h index 541e2c326..64a238231 100644 --- a/Source/render.h +++ b/Source/render.h @@ -22,9 +22,9 @@ extern DWORD gdwCurrentMask; extern BYTE *gpCelFrame; extern DWORD *gpDrawMask; // extern char world_4B326D[16]; -extern DWORD RightMask[32]; -extern DWORD LeftMask[32]; -extern DWORD WallMask[32]; +extern DWORD RightMask[TILE_WIDTH]; +extern DWORD LeftMask[TILE_WIDTH]; +extern DWORD WallMask[TILE_WIDTH]; extern int WorldTbl3x16[48]; extern int WorldTbl17_1[17]; extern int WorldTbl17_2[17]; From cc09635b7169c550b842b8fc97c7b1c4d53ba2d2 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sun, 27 Sep 2020 15:43:43 +0200 Subject: [PATCH 3/9] Calculate x posistion of PrintSBookStr --- Source/control.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/control.cpp b/Source/control.cpp index 01a5331ec..513ebb8ce 100644 --- a/Source/control.cpp +++ b/Source/control.cpp @@ -2405,7 +2405,7 @@ void PrintSBookStr(int x, int y, BOOL cjustflag, char *pszStr, char col) char *tmp; int screen_x, line, width; - width = PitchTbl[y] + x + RIGHT_PANEL + 120; + width = PitchTbl[y] + x + RIGHT_PANEL_X + SPLICONLENGTH; line = 0; if (cjustflag) { screen_x = 0; From 29efef6987fd2b7d382b50d45165eeefb182ba85 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sun, 27 Sep 2020 16:19:57 +0200 Subject: [PATCH 4/9] Decompose cords in control_print_talk_msg() --- Source/control.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/control.cpp b/Source/control.cpp index 513ebb8ce..44810036e 100644 --- a/Source/control.cpp +++ b/Source/control.cpp @@ -2633,8 +2633,8 @@ char *control_print_talk_msg(char *msg, int x, int y, int *nOffset, int color) BYTE c; int width; - x += 264; - y += 182 + PANEL_TOP; + x += 200 + SCREEN_X; + y += 22 + PANEL_Y; width = x; *nOffset = PitchTbl[y] + x; while (*msg) { From 2a3db5f316313486b12bd1a484995f9556a73954 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Mon, 28 Sep 2020 01:49:27 +0200 Subject: [PATCH 5/9] Clean up DrawDurIcon --- Source/control.cpp | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/Source/control.cpp b/Source/control.cpp index 44810036e..7610e0d7a 100644 --- a/Source/control.cpp +++ b/Source/control.cpp @@ -2189,18 +2189,20 @@ void ReleaseChrBtns() void DrawDurIcon() { PlayerStruct *p; - int x1, x2, x3, x4; - - if (!chrflag && !questlog || !invflag && !sbookflag) { - x1 = 272 + RIGHT_PANEL_X; - if (invflag || sbookflag) - x1 = 272 + PANEL_X; - p = &plr[myplr]; - x2 = DrawDurIcon4Item(&p->InvBody[INVLOC_HEAD], x1, 4); - x3 = DrawDurIcon4Item(&p->InvBody[INVLOC_CHEST], x2, 3); - x4 = DrawDurIcon4Item(&p->InvBody[INVLOC_HAND_LEFT], x3, 0); - DrawDurIcon4Item(&p->InvBody[INVLOC_HAND_RIGHT], x4, 0); - } + int x; + + if ((chrflag || questlog) && (invflag || sbookflag)) + return; + + x = PANEL_X + PANEL_WIDTH - 32 - 16; + if (invflag || sbookflag) + x -= SPANEL_WIDTH; + + p = &plr[myplr]; + x = DrawDurIcon4Item(&p->InvBody[INVLOC_HEAD], x, 4); + x = DrawDurIcon4Item(&p->InvBody[INVLOC_CHEST], x, 3); + x = DrawDurIcon4Item(&p->InvBody[INVLOC_HAND_LEFT], x, 0); + DrawDurIcon4Item(&p->InvBody[INVLOC_HAND_RIGHT], x, 0); } int DrawDurIcon4Item(ItemStruct *pItem, int x, int c) From 4c02613cd03dcb55f249102eae0ef42f8d2613f8 Mon Sep 17 00:00:00 2001 From: pionere Date: Fri, 25 Sep 2020 15:58:44 +0200 Subject: [PATCH 6/9] maxitems --- Source/inv.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/inv.cpp b/Source/inv.cpp index ae91ae1a8..dfe5502d8 100644 --- a/Source/inv.cpp +++ b/Source/inv.cpp @@ -1766,7 +1766,7 @@ BOOL TryInvPut() { int dir; - if (numitems >= 127) + if (numitems >= MAXITEMS) return FALSE; dir = GetDirection(plr[myplr]._px, plr[myplr]._py, cursmx, cursmy); @@ -1806,7 +1806,7 @@ int InvPutItem(int pnum, int x, int y) int xx, yy; int xp, yp; - if (numitems >= 127) + if (numitems >= MAXITEMS) return -1; if (FindGetItem(plr[pnum].HoldItem.IDidx, plr[pnum].HoldItem._iCreateInfo, plr[pnum].HoldItem._iSeed) != -1) { @@ -1875,7 +1875,7 @@ int SyncPutItem(int pnum, int x, int y, int idx, WORD icreateinfo, int iseed, in int xx, yy; int xp, yp; - if (numitems >= 127) + if (numitems >= MAXITEMS) return -1; if (FindGetItem(idx, icreateinfo, iseed) != -1) { From 198d8a1142af6f7e2547ad1c2670009de70f8251 Mon Sep 17 00:00:00 2001 From: pionere Date: Sun, 27 Sep 2020 11:47:49 +0200 Subject: [PATCH 7/9] BOOLs --- Source/drlg_l1.cpp | 18 +++++++++--------- Source/drlg_l2.cpp | 18 +++++++++--------- Source/drlg_l3.cpp | 18 +++++++++--------- Source/drlg_l4.cpp | 42 +++++++++++++++++++++--------------------- 4 files changed, 48 insertions(+), 48 deletions(-) diff --git a/Source/drlg_l1.cpp b/Source/drlg_l1.cpp index 12bf22e9c..c8cf46aab 100644 --- a/Source/drlg_l1.cpp +++ b/Source/drlg_l1.cpp @@ -1750,20 +1750,20 @@ static void DRLG_L5(int entry) if (QuestStatus(Q_PWATER)) { if (entry == 0) { - if (DRLG_PlaceMiniSet(PWATERIN, 1, 1, 0, 0, 1, -1, 0) < 0) + if (DRLG_PlaceMiniSet(PWATERIN, 1, 1, 0, 0, TRUE, -1, 0) < 0) doneflag = FALSE; } else { - if (DRLG_PlaceMiniSet(PWATERIN, 1, 1, 0, 0, 0, -1, 0) < 0) + if (DRLG_PlaceMiniSet(PWATERIN, 1, 1, 0, 0, FALSE, -1, 0) < 0) doneflag = FALSE; ViewY--; } } if (QuestStatus(Q_LTBANNER)) { if (entry == 0) { - if (DRLG_PlaceMiniSet(STAIRSUP, 1, 1, 0, 0, 1, -1, 0) < 0) + if (DRLG_PlaceMiniSet(STAIRSUP, 1, 1, 0, 0, TRUE, -1, 0) < 0) doneflag = FALSE; } else { - if (DRLG_PlaceMiniSet(STAIRSUP, 1, 1, 0, 0, 0, -1, 0) < 0) + if (DRLG_PlaceMiniSet(STAIRSUP, 1, 1, 0, 0, FALSE, -1, 0) < 0) doneflag = FALSE; if (entry == 1) { ViewX = 2 * setpc_x + 20; @@ -1773,14 +1773,14 @@ static void DRLG_L5(int entry) } } } else if (entry == 0) { - if (DRLG_PlaceMiniSet(L5STAIRSUP, 1, 1, 0, 0, 1, -1, 0) < 0) + if (DRLG_PlaceMiniSet(L5STAIRSUP, 1, 1, 0, 0, TRUE, -1, 0) < 0) doneflag = FALSE; - else if (DRLG_PlaceMiniSet(STAIRSDOWN, 1, 1, 0, 0, 0, -1, 1) < 0) + else if (DRLG_PlaceMiniSet(STAIRSDOWN, 1, 1, 0, 0, FALSE, -1, 1) < 0) doneflag = FALSE; } else { - if (DRLG_PlaceMiniSet(L5STAIRSUP, 1, 1, 0, 0, 0, -1, 0) < 0) + if (DRLG_PlaceMiniSet(L5STAIRSUP, 1, 1, 0, 0, FALSE, -1, 0) < 0) doneflag = FALSE; - else if (DRLG_PlaceMiniSet(STAIRSDOWN, 1, 1, 0, 0, 1, -1, 1) < 0) + else if (DRLG_PlaceMiniSet(STAIRSDOWN, 1, 1, 0, 0, TRUE, -1, 1) < 0) doneflag = FALSE; ViewY--; } @@ -1810,7 +1810,7 @@ static void DRLG_L5(int entry) DRLG_L5Subs(); DRLG_L1Shadows(); - DRLG_PlaceMiniSet(LAMPS, 5, 10, 0, 0, 0, -1, 4); + DRLG_PlaceMiniSet(LAMPS, 5, 10, 0, 0, FALSE, -1, 4); DRLG_L1Floor(); for (j = 0; j < DMAXY; j++) { diff --git a/Source/drlg_l2.cpp b/Source/drlg_l2.cpp index f0d2678ae..454e3e5fd 100644 --- a/Source/drlg_l2.cpp +++ b/Source/drlg_l2.cpp @@ -3170,29 +3170,29 @@ static void DRLG_L2(int entry) DRLG_L2FloodTVal(); DRLG_L2TransFix(); if (entry == 0) { - doneflag = DRLG_L2PlaceMiniSet(USTAIRS, 1, 1, -1, -1, 1, 0); + doneflag = DRLG_L2PlaceMiniSet(USTAIRS, 1, 1, -1, -1, TRUE, 0); if (doneflag) { - doneflag = DRLG_L2PlaceMiniSet(DSTAIRS, 1, 1, -1, -1, 0, 1); + doneflag = DRLG_L2PlaceMiniSet(DSTAIRS, 1, 1, -1, -1, FALSE, 1); if (doneflag && currlevel == 5) { - doneflag = DRLG_L2PlaceMiniSet(WARPSTAIRS, 1, 1, -1, -1, 0, 6); + doneflag = DRLG_L2PlaceMiniSet(WARPSTAIRS, 1, 1, -1, -1, FALSE, 6); } } ViewY -= 2; } else if (entry == 1) { - doneflag = DRLG_L2PlaceMiniSet(USTAIRS, 1, 1, -1, -1, 0, 0); + doneflag = DRLG_L2PlaceMiniSet(USTAIRS, 1, 1, -1, -1, FALSE, 0); if (doneflag) { - doneflag = DRLG_L2PlaceMiniSet(DSTAIRS, 1, 1, -1, -1, 1, 1); + doneflag = DRLG_L2PlaceMiniSet(DSTAIRS, 1, 1, -1, -1, TRUE, 1); if (doneflag && currlevel == 5) { - doneflag = DRLG_L2PlaceMiniSet(WARPSTAIRS, 1, 1, -1, -1, 0, 6); + doneflag = DRLG_L2PlaceMiniSet(WARPSTAIRS, 1, 1, -1, -1, FALSE, 6); } } ViewX--; } else { - doneflag = DRLG_L2PlaceMiniSet(USTAIRS, 1, 1, -1, -1, 0, 0); + doneflag = DRLG_L2PlaceMiniSet(USTAIRS, 1, 1, -1, -1, FALSE, 0); if (doneflag) { - doneflag = DRLG_L2PlaceMiniSet(DSTAIRS, 1, 1, -1, -1, 0, 1); + doneflag = DRLG_L2PlaceMiniSet(DSTAIRS, 1, 1, -1, -1, FALSE, 1); if (doneflag && currlevel == 5) { - doneflag = DRLG_L2PlaceMiniSet(WARPSTAIRS, 1, 1, -1, -1, 1, 6); + doneflag = DRLG_L2PlaceMiniSet(WARPSTAIRS, 1, 1, -1, -1, TRUE, 6); } } ViewY -= 2; diff --git a/Source/drlg_l3.cpp b/Source/drlg_l3.cpp index 4cc0844f4..e4e1ae758 100644 --- a/Source/drlg_l3.cpp +++ b/Source/drlg_l3.cpp @@ -1940,29 +1940,29 @@ static void DRLG_L3(int entry) } while (!found); DRLG_L3MakeMegas(); if (entry == 0) { - genok = DRLG_L3PlaceMiniSet(L3UP, 1, 1, -1, -1, 1, 0); + genok = DRLG_L3PlaceMiniSet(L3UP, 1, 1, -1, -1, TRUE, 0); if (!genok) { - genok = DRLG_L3PlaceMiniSet(L3DOWN, 1, 1, -1, -1, 0, 1); + genok = DRLG_L3PlaceMiniSet(L3DOWN, 1, 1, -1, -1, FALSE, 1); if (!genok && currlevel == 9) { - genok = DRLG_L3PlaceMiniSet(L3HOLDWARP, 1, 1, -1, -1, 0, 6); + genok = DRLG_L3PlaceMiniSet(L3HOLDWARP, 1, 1, -1, -1, FALSE, 6); } } } else if (entry == 1) { - genok = DRLG_L3PlaceMiniSet(L3UP, 1, 1, -1, -1, 0, 0); + genok = DRLG_L3PlaceMiniSet(L3UP, 1, 1, -1, -1, FALSE, 0); if (!genok) { - genok = DRLG_L3PlaceMiniSet(L3DOWN, 1, 1, -1, -1, 1, 1); + genok = DRLG_L3PlaceMiniSet(L3DOWN, 1, 1, -1, -1, TRUE, 1); ViewX += 2; ViewY -= 2; if (!genok && currlevel == 9) { - genok = DRLG_L3PlaceMiniSet(L3HOLDWARP, 1, 1, -1, -1, 0, 6); + genok = DRLG_L3PlaceMiniSet(L3HOLDWARP, 1, 1, -1, -1, FALSE, 6); } } } else { - genok = DRLG_L3PlaceMiniSet(L3UP, 1, 1, -1, -1, 0, 0); + genok = DRLG_L3PlaceMiniSet(L3UP, 1, 1, -1, -1, FALSE, 0); if (!genok) { - genok = DRLG_L3PlaceMiniSet(L3DOWN, 1, 1, -1, -1, 0, 1); + genok = DRLG_L3PlaceMiniSet(L3DOWN, 1, 1, -1, -1, FALSE, 1); if (!genok && currlevel == 9) { - genok = DRLG_L3PlaceMiniSet(L3HOLDWARP, 1, 1, -1, -1, 1, 6); + genok = DRLG_L3PlaceMiniSet(L3HOLDWARP, 1, 1, -1, -1, TRUE, 6); } } } diff --git a/Source/drlg_l4.cpp b/Source/drlg_l4.cpp index 9c3fd94bb..0ccfab4b5 100644 --- a/Source/drlg_l4.cpp +++ b/Source/drlg_l4.cpp @@ -1612,72 +1612,72 @@ static void DRLG_L4(int entry) } if (QuestStatus(Q_WARLORD)) { if (entry == 0) { - doneflag = DRLG_L4PlaceMiniSet(L4USTAIRS, 1, 1, -1, -1, 1, 0); + doneflag = DRLG_L4PlaceMiniSet(L4USTAIRS, 1, 1, -1, -1, TRUE, 0); if (doneflag && currlevel == 13) { - doneflag = DRLG_L4PlaceMiniSet(L4TWARP, 1, 1, -1, -1, 0, 6); + doneflag = DRLG_L4PlaceMiniSet(L4TWARP, 1, 1, -1, -1, FALSE, 6); } ViewX++; } else if (entry == 1) { - doneflag = DRLG_L4PlaceMiniSet(L4USTAIRS, 1, 1, -1, -1, 0, 0); + doneflag = DRLG_L4PlaceMiniSet(L4USTAIRS, 1, 1, -1, -1, FALSE, 0); if (doneflag && currlevel == 13) { - doneflag = DRLG_L4PlaceMiniSet(L4TWARP, 1, 1, -1, -1, 0, 6); + doneflag = DRLG_L4PlaceMiniSet(L4TWARP, 1, 1, -1, -1, FALSE, 6); } ViewX = 2 * setpc_x + 22; ViewY = 2 * setpc_y + 22; } else { - doneflag = DRLG_L4PlaceMiniSet(L4USTAIRS, 1, 1, -1, -1, 0, 0); + doneflag = DRLG_L4PlaceMiniSet(L4USTAIRS, 1, 1, -1, -1, FALSE, 0); if (doneflag && currlevel == 13) { - doneflag = DRLG_L4PlaceMiniSet(L4TWARP, 1, 1, -1, -1, 1, 6); + doneflag = DRLG_L4PlaceMiniSet(L4TWARP, 1, 1, -1, -1, TRUE, 6); } ViewX++; } } else if (currlevel != 15) { if (entry == 0) { - doneflag = DRLG_L4PlaceMiniSet(L4USTAIRS, 1, 1, -1, -1, 1, 0); + doneflag = DRLG_L4PlaceMiniSet(L4USTAIRS, 1, 1, -1, -1, TRUE, 0); if (doneflag && currlevel != 16) { - doneflag = DRLG_L4PlaceMiniSet(L4DSTAIRS, 1, 1, -1, -1, 0, 1); + doneflag = DRLG_L4PlaceMiniSet(L4DSTAIRS, 1, 1, -1, -1, FALSE, 1); } if (doneflag && currlevel == 13) { - doneflag = DRLG_L4PlaceMiniSet(L4TWARP, 1, 1, -1, -1, 0, 6); + doneflag = DRLG_L4PlaceMiniSet(L4TWARP, 1, 1, -1, -1, FALSE, 6); } ViewX++; } else if (entry == 1) { - doneflag = DRLG_L4PlaceMiniSet(L4USTAIRS, 1, 1, -1, -1, 0, 0); + doneflag = DRLG_L4PlaceMiniSet(L4USTAIRS, 1, 1, -1, -1, FALSE, 0); if (doneflag && currlevel != 16) { - doneflag = DRLG_L4PlaceMiniSet(L4DSTAIRS, 1, 1, -1, -1, 1, 1); + doneflag = DRLG_L4PlaceMiniSet(L4DSTAIRS, 1, 1, -1, -1, TRUE, 1); } if (doneflag && currlevel == 13) { - doneflag = DRLG_L4PlaceMiniSet(L4TWARP, 1, 1, -1, -1, 0, 6); + doneflag = DRLG_L4PlaceMiniSet(L4TWARP, 1, 1, -1, -1, FALSE, 6); } ViewY++; } else { - doneflag = DRLG_L4PlaceMiniSet(L4USTAIRS, 1, 1, -1, -1, 0, 0); + doneflag = DRLG_L4PlaceMiniSet(L4USTAIRS, 1, 1, -1, -1, FALSE, 0); if (doneflag && currlevel != 16) { - doneflag = DRLG_L4PlaceMiniSet(L4DSTAIRS, 1, 1, -1, -1, 0, 1); + doneflag = DRLG_L4PlaceMiniSet(L4DSTAIRS, 1, 1, -1, -1, FALSE, 1); } if (doneflag && currlevel == 13) { - doneflag = DRLG_L4PlaceMiniSet(L4TWARP, 1, 1, -1, -1, 1, 6); + doneflag = DRLG_L4PlaceMiniSet(L4TWARP, 1, 1, -1, -1, TRUE, 6); } ViewX++; } } else { if (entry == 0) { - doneflag = DRLG_L4PlaceMiniSet(L4USTAIRS, 1, 1, -1, -1, 1, 0); + doneflag = DRLG_L4PlaceMiniSet(L4USTAIRS, 1, 1, -1, -1, TRUE, 0); if (doneflag) { if (gbMaxPlayers == 1 && quests[Q_DIABLO]._qactive != QUEST_ACTIVE) { - doneflag = DRLG_L4PlaceMiniSet(L4PENTA, 1, 1, -1, -1, 0, 1); + doneflag = DRLG_L4PlaceMiniSet(L4PENTA, 1, 1, -1, -1, FALSE, 1); } else { - doneflag = DRLG_L4PlaceMiniSet(L4PENTA2, 1, 1, -1, -1, 0, 1); + doneflag = DRLG_L4PlaceMiniSet(L4PENTA2, 1, 1, -1, -1, FALSE, 1); } } ViewX++; } else { - doneflag = DRLG_L4PlaceMiniSet(L4USTAIRS, 1, 1, -1, -1, 0, 0); + doneflag = DRLG_L4PlaceMiniSet(L4USTAIRS, 1, 1, -1, -1, FALSE, 0); if (doneflag) { if (gbMaxPlayers == 1 && quests[Q_DIABLO]._qactive != QUEST_ACTIVE) { - doneflag = DRLG_L4PlaceMiniSet(L4PENTA, 1, 1, -1, -1, 1, 1); + doneflag = DRLG_L4PlaceMiniSet(L4PENTA, 1, 1, -1, -1, TRUE, 1); } else { - doneflag = DRLG_L4PlaceMiniSet(L4PENTA2, 1, 1, -1, -1, 1, 1); + doneflag = DRLG_L4PlaceMiniSet(L4PENTA2, 1, 1, -1, -1, TRUE, 1); } } ViewY++; From f6d16b4907632cd4049f0c0f2480eb4262851920 Mon Sep 17 00:00:00 2001 From: pionere Date: Sun, 27 Sep 2020 11:48:33 +0200 Subject: [PATCH 8/9] UCHAR_MAX to squelch --- Source/monster.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/monster.cpp b/Source/monster.cpp index 430476f87..8e690671a 100644 --- a/Source/monster.cpp +++ b/Source/monster.cpp @@ -4572,7 +4572,7 @@ void ProcessMonsters() Monst->_menemyx = plr[Monst->_menemy]._pfutx; Monst->_menemyy = plr[Monst->_menemy]._pfuty; if (dFlags[mx][my] & BFLAG_VISIBLE) { - Monst->_msquelch = 255; + Monst->_msquelch = UCHAR_MAX; Monst->_lastx = plr[Monst->_menemy]._pfutx; Monst->_lasty = plr[Monst->_menemy]._pfuty; } else if (Monst->_msquelch != 0 && Monst->_mAi != MT_DIABLO) { /// BUGFIX: change '_mAi' to 'MType->mtype' From c2d54ad39e8447f3fb01cea34d3fdc6e6adb9a64 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Mon, 28 Sep 2020 02:03:40 +0200 Subject: [PATCH 9/9] Decompose number --- Source/control.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/control.cpp b/Source/control.cpp index 7610e0d7a..3f88523ae 100644 --- a/Source/control.cpp +++ b/Source/control.cpp @@ -2237,7 +2237,7 @@ int DrawDurIcon4Item(ItemStruct *pItem, int x, int c) if (pItem->_iDurability > 2) c += 8; CelDraw(x, -17 + PANEL_Y, pDurIcons, c, 32); - return x - 40; + return x - 32 + 8; } void RedBack()