From 6755ff243d4586d0e89c108ddb2cd5fb53eae8ff Mon Sep 17 00:00:00 2001 From: Sveinung Kvilhaugsvik Date: Wed, 10 Feb 2021 17:38:19 +0100 Subject: [PATCH] action_target_neg_util(): tgt kind may vary. Prepare action_target_neg_util() for actions that may be city targeted in some rulesets but not in others. See osdn #41550 --- ai/default/daicity.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ai/default/daicity.c b/ai/default/daicity.c index ea84b2f9b2..2327f7ed9c 100644 --- a/ai/default/daicity.c +++ b/ai/default/daicity.c @@ -1205,6 +1205,11 @@ static int action_target_neg_util(action_id act_id, fc_assert_msg(action_id_exists(act_id), "Action %d don't exist.", act_id); + if (action_get_target_kind(paction) != ATK_CITY) { + /* Not city targeted in this ruleset. */ + return 0; + } + switch (paction->result) { case ACTRES_SPY_INCITE_CITY: /* Copied from the evaluation of the No_Incite effect */ -- 2.20.1