From ae93b1dbb1a7a967ab862c4f0b16549aa2ce7c8f Mon Sep 17 00:00:00 2001 From: AdamPlenty <58278560+AdamPlenty@users.noreply.github.com> Date: Fri, 24 Nov 2023 14:07:10 +0000 Subject: [PATCH] Creatures on guard posts will do hold audiance correctly (#2742) Fixes #2740 --- src/creature_states_combt.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/creature_states_combt.c b/src/creature_states_combt.c index 2bfe8682dc..ed6eca8c0b 100644 --- a/src/creature_states_combt.c +++ b/src/creature_states_combt.c @@ -1747,8 +1747,11 @@ long ranged_combat_move(struct Thing *thing, struct Thing *enmtng, MapCoordDelta } if (cctrl->job_assigned == Job_GUARD) { - if (guard_post_combat_move(thing, nstat)) { - return false; + if ((cctrl->turns_at_job > 0)) + { + if (guard_post_combat_move(thing, nstat)) { + return false; + } } } if (!combat_has_line_of_sight(thing, enmtng, enmdist)) @@ -2264,8 +2267,11 @@ long melee_combat_move(struct Thing *thing, struct Thing *enmtng, long enmdist, } if (cctrl->job_assigned == Job_GUARD) { - if (guard_post_combat_move(thing, nstat)) { - return false; + if ((cctrl->turns_at_job > 0)) + { + if (guard_post_combat_move(thing, nstat)) { + return false; + } } } if (enmdist < 156) @@ -2652,8 +2658,11 @@ long waiting_combat_move(struct Thing *figtng, struct Thing *enmtng, long enmdis } if (figctrl->job_assigned == Job_GUARD) { - if (guard_post_combat_move(figtng, retreat_crstate)) { - return 0; + if ((figctrl->turns_at_job > 0)) + { + if (guard_post_combat_move(figtng, retreat_crstate)) { + return false; + } } } if (enmdist < 768) {