Browse Source

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
pull/5295/head
Robin 4 years ago committed by GitHub
parent
commit
a401471daf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      Source/diablo.cpp

1
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);
}

Loading…
Cancel
Save