Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

diablo: add BUGFIX for PressChar; out-of-bounds access to dungeon #2266

Merged
merged 2 commits into from
Jan 18, 2022

Conversation

mewmew
Copy link
Contributor

@mewmew mewmew commented Jan 17, 2022

No description provided.

@mewmew
Copy link
Contributor Author

mewmew commented Jan 17, 2022

This issue was identified in a network game playing with @7i :)

@@ -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 `dungeon[(cursmx-16)/2][(cursmy-16)/2]`, was `dungeon[cursmx][cursmy]`.
sprintf(tempstr, "CX = %i CY = %i DP = %i", cursmx, cursmy, dungeon[cursmx][cursmy]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I fixed this one many moons ago. You can see the string says "DP" for "dungeon piece" but they used the wrong array. It should be dPiece[cursmx][cursmy] :)

@galaxyhaxz galaxyhaxz merged commit a401471 into diasurgical:master Jan 18, 2022
@galaxyhaxz
Copy link
Member

LGTM! 🇸🇪

@mewmew mewmew deleted the bugfix-PressChar branch January 18, 2022 01:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants