Skip to content

Commit

Permalink
Creatures on guard posts will do hold audiance correctly (dkfans#2742)
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamPlenty authored Nov 24, 2023
1 parent 010cf46 commit ae93b1d
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions src/creature_states_combt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit ae93b1d

Please sign in to comment.