From 7596d4d721fab1c34bf047a96eb470517d9ce040 Mon Sep 17 00:00:00 2001 From: Alexander Batalov Date: Tue, 13 Dec 2022 22:18:12 +0300 Subject: [PATCH] Fix combat_is_shot_blocked --- src/combat.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/combat.cc b/src/combat.cc index bad5319..0e4d755 100644 --- a/src/combat.cc +++ b/src/combat.cc @@ -5919,8 +5919,13 @@ bool _combat_is_shot_blocked(Object* a1, int from, int to, Object* a4, int* a5) } if ((obstacle->flags & OBJECT_MULTIHEX) != 0) { - int rotation = tileGetRotationTo(current, to); - current = tileGetTileInDirection(current, rotation, 1); + // SFALL: Fix obtaining the next tile from a multihex object. + // This bug does not cause any noticeable error in the function. + current = obstacle->tile; + if (current != to) { + int rotation = tileGetRotationTo(current, to); + current = tileGetTileInDirection(current, rotation, 1); + } } else { current = obstacle->tile; }