From b11d67554354086b4346d173a3f224894ebaf7b0 Mon Sep 17 00:00:00 2001 From: Robin Eklind Date: Mon, 8 Mar 2021 01:55:08 +0100 Subject: [PATCH] monster: add BUGFIX for M_FallenFear The index used to access monster was incorrect for the fallen one flee behaviour. The AI should make fallen ones flee from the direction of the monster which got hit. Right now, it's random as the wrong index is used. --- Source/monster.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/monster.cpp b/Source/monster.cpp index e89b7cf2a..87a9ada2c 100644 --- a/Source/monster.cpp +++ b/Source/monster.cpp @@ -5993,6 +5993,7 @@ void M_FallenFear(int x, int y) && monster[mi]._mhitpoints >> 6 > 0) { monster[mi]._mgoal = MGOAL_RETREAT; monster[mi]._mgoalvar1 = rundist; + // BUGFIX: should be `monster[mi]`, was `monster[i]`. monster[mi]._mdir = GetDirection(x, y, monster[i]._mx, monster[i]._my); } }