From 12a2fa334e1f3e88f19f9abb67db3c5288a78d8f Mon Sep 17 00:00:00 2001 From: Ihnatus Date: Sun, 14 Mar 2021 01:32:38 +0300 Subject: [PATCH] Consider defenders' ability to fortify for tech want Signed-off-by: Ihnatus --- ai/default/aitech.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ai/default/aitech.c b/ai/default/aitech.c index 90d75482fd..46a5a038b3 100644 --- a/ai/default/aitech.c +++ b/ai/default/aitech.c @@ -384,6 +384,10 @@ struct unit_type *dai_wants_defender_against(struct ai_type *ait, int div_bonus = combat_bonus_against(att->bonuses, deftype, CBONUS_DEFENSE_DIVIDER) + 1; int def = deftype->defense_strength * mp / div_bonus; + if (uclass_has_flag(utype_class(deftype), UCF_CAN_FORTIFY) + && !utype_has_flag(deftype, UTYF_CANT_FORTIFY)) { + def = def * 3 / 2; + } def_values[utype_index(deftype)] = def; if (can_city_build_unit_now(pcity, deftype)) { -- 2.27.0