From a401471daf37144ec3be3a56c19314f8a844bcb6 Mon Sep 17 00:00:00 2001 From: Robin Date: Tue, 18 Jan 2022 01:38:37 +0100 Subject: [PATCH] diablo: add BUGFIX for PressChar; out-of-bounds access to dungeon (#2266) * diablo: add BUGFIX for PressChar; out-of-bounds access to dungeon * diablo: update BUGFIX comment of PressChar, should be dPiece not dungeon Pointed out by @galaxyhaxz in https://github.com/diasurgical/devilution/pull/2266#discussion_r786302976 --- Source/diablo.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/diablo.cpp b/Source/diablo.cpp index 48780e7ad..62450c682 100644 --- a/Source/diablo.cpp +++ b/Source/diablo.cpp @@ -1520,6 +1520,7 @@ static void PressChar(WPARAM vkey) if (debug_mode_key_inverted_v) { sprintf(tempstr, "PX = %i PY = %i", plr[myplr]._px, plr[myplr]._py); NetSendCmdString(1 << myplr, tempstr); + // BUGFIX: out-of-bounds access to dungeon; should be `dPiece[cursmx][cursmy]`, was `dungeon[cursmx][cursmy]`. sprintf(tempstr, "CX = %i CY = %i DP = %i", cursmx, cursmy, dungeon[cursmx][cursmy]); NetSendCmdString(1 << myplr, tempstr); }