From b86b8fd7c4966385e3a7dbcb29e6d7e05bdab95e Mon Sep 17 00:00:00 2001 From: Robin Date: Sat, 14 May 2022 02:40:18 +0200 Subject: [PATCH] msg: add BUGFIX for delta_kill_monster (#2261) The monster direction is synced even if the receiving player is not on the same dungeon level as the player killing the monster. Note, this happens, even if one player is in town, and the other kills a monster at e.g. dlvl=1. Then the code will check the monster at index mi even for the player in town, so it will just read garbage data from memory. --- Source/msg.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/msg.cpp b/Source/msg.cpp index 461d134e3..331b97365 100644 --- a/Source/msg.cpp +++ b/Source/msg.cpp @@ -461,6 +461,7 @@ void delta_kill_monster(int mi, BYTE x, BYTE y, BYTE bLevel) DMonsterStr *pD = &sgLevels[bLevel].monster[mi]; pD->_mx = x; pD->_my = y; + // BUGFIX: should only sync monster direction if bLevel is same as currlevel. pD->_mdir = monster[mi]._mdir; pD->_mhitpoints = 0; }