From cf4989bcbb7c7b57bbe86362c96a98cd8d36c4d2 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Thu, 26 Aug 2021 04:59:40 +0200 Subject: [PATCH] [hellfire] Fix monsters being unable to hit at close range This seams to have been done to better align the magic missile fired by the bonedeamon, but for all other monsters the alignment is less ideal and they become unable to hit there enemy at close range. --- Source/monster.cpp | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/Source/monster.cpp b/Source/monster.cpp index 991a37624..37b9e77f8 100644 --- a/Source/monster.cpp +++ b/Source/monster.cpp @@ -1588,21 +1588,17 @@ bool MonaterRangedAttack(int i) assert(monster.MData != nullptr); if (monster.AnimInfo.CurrentFrame == monster.MData->mAFNum) { - if (monster._mVar1 != -1) { + const auto &missileType = static_cast(monster._mVar1); + if (missileType != MIS_NULL) { int multimissiles = 1; - if (monster._mVar1 == MIS_CBOLT) + if (missileType == MIS_CBOLT) multimissiles = 3; for (int mi = 0; mi < multimissiles; mi++) { - Point sourcePosition = monster.position.tile; - if (gbIsHellfire) { - sourcePosition += monster._mdir; - } - AddMissile( - sourcePosition, + monster.position.tile, monster.enemyPosition, monster._mdir, - static_cast(monster._mVar1), + missileType, TARGET_PLAYERS, i, monster._mVar2, @@ -1628,13 +1624,8 @@ bool MonsterRangedSpecialAttack(int i) assert(monster.MData != nullptr); if (monster.AnimInfo.CurrentFrame == monster.MData->mAFNum2 && monster.AnimInfo.TickCounterOfCurrentFrame == 0) { - Point sourcePosition = monster.position.tile; - if (gbIsHellfire) { - sourcePosition += monster._mdir; - } - AddMissile( - sourcePosition, + monster.position.tile, monster.enemyPosition, monster._mdir, static_cast(monster._mVar1),