diff --git a/Source/control.cpp b/Source/control.cpp index a719541c7..39f1fdf07 100644 --- a/Source/control.cpp +++ b/Source/control.cpp @@ -258,8 +258,8 @@ void DrawSpellList() pSpell = SPL_INVALID; infostr[0] = '\0'; - x = 636; - y = 495; + x = 636 + PANEL_LEFT; + y = 495 + HEIGHT_DIFF; ClearPanel(); for (i = 0; i < 4; i++) { switch ((spell_type)i) { @@ -362,16 +362,16 @@ void DrawSpellList() } } x -= 56; - if (x == 20) { + if (x == 20 + PANEL_LEFT) { y -= 56; - x = 636; + x = 636 + PANEL_LEFT; } } - if (mask != 0 && x != 636) + if (mask != 0 && x != 636 + PANEL_LEFT) x -= 56; - if (x == 20) { + if (x == 20 + PANEL_LEFT) { y -= 56; - x = 636; + x = 636 + PANEL_LEFT; } } } @@ -804,10 +804,10 @@ void DoSpeedBook() int xo, yo, X, Y, i, j; spselflag = 1; - xo = 636; - yo = 495; - X = 600; - Y = 307; + xo = 636 + PANEL_LEFT; + yo = 495 + HEIGHT_DIFF; + X = 600 + PANEL_LEFT; + Y = 307 + HEIGHT_DIFF; if (plr[myplr]._pRSpell != SPL_INVALID) { for (i = 0; i < 4; i++) { switch (i) { @@ -832,17 +832,17 @@ void DoSpeedBook() Y = yo - 188; } xo -= 56; - if (xo == 20) { - xo = 636; + if (xo == 20 + PANEL_LEFT) { + xo = 636 + PANEL_LEFT; yo -= 56; } } spell <<= (__int64)1; } - if (spells && xo != 636) + if (spells && xo != 636 + PANEL_LEFT) xo -= 56; - if (xo == 20) { - xo = 636; + if (xo == 20 + PANEL_LEFT) { + xo = 636 + PANEL_LEFT; yo -= 56; } } diff --git a/Source/cursor.cpp b/Source/cursor.cpp index 827315e0f..69655c4dc 100644 --- a/Source/cursor.cpp +++ b/Source/cursor.cpp @@ -292,7 +292,7 @@ void CheckCursMove() if (sbookflag && MouseX > RIGHT_PANEL && MouseY <= SPANEL_HEIGHT) { return; } - if ((chrflag || questlog) && MouseX < RIGHT_PANEL) { + if ((chrflag || questlog) && MouseX < 320 && MouseY <= SPANEL_HEIGHT) { return; } diff --git a/Source/player.cpp b/Source/player.cpp index d172c6154..4cdd25750 100644 --- a/Source/player.cpp +++ b/Source/player.cpp @@ -3688,8 +3688,8 @@ void CheckPlrSpell() } if (pcurs != CURSOR_HAND - || MouseY >= PANEL_TOP - || (chrflag && MouseX < 320 || invflag && MouseX > RIGHT_PANEL) + || (MouseY >= PANEL_TOP && MouseX >= PANEL_LEFT && MouseX <= RIGHT_PANEL) // allows casting spells through the sides of the main panel if it doesn't cover the whole screen + || ((chrflag || questlog) && MouseX < 320 && MouseY < SPANEL_HEIGHT) || (invflag && MouseX > RIGHT_PANEL && MouseY < SPANEL_HEIGHT) // allows casting spells below the side panels && rspell != SPL_HEAL && rspell != SPL_IDENTIFY && rspell != SPL_REPAIR diff --git a/defs.h b/defs.h index 1a134dc5b..cf81411bc 100644 --- a/defs.h +++ b/defs.h @@ -113,6 +113,7 @@ #define SCREEN_X BORDER_LEFT #define SCREEN_Y BORDER_TOP +#define HEIGHT_DIFF (SCREEN_HEIGHT - 480) #define BUFFER_WIDTH (BORDER_LEFT + SCREEN_WIDTH + BORDER_RIGHT) #define BUFFER_HEIGHT (BORDER_TOP + SCREEN_HEIGHT + BORDER_BOTTOM)