From 96adf6da6d02b7fc50182f166025287387c4c865 Mon Sep 17 00:00:00 2001 From: Sveinung Kvilhaugsvik Date: Wed, 19 May 2021 13:38:41 +0200 Subject: [PATCH] Support unit requirements in Unit_No_Lose_Pop. See osdn #42320 --- doc/README.effects | 3 ++- server/unithand.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/README.effects b/doc/README.effects index 2a8364d70e..ca1bbf5640 100644 --- a/doc/README.effects +++ b/doc/README.effects @@ -407,7 +407,8 @@ Move_Bonus Unit_No_Lose_Pop No population lost when a city's defender is lost. Can be limited to -only apply to some actions via an Action requirement. +only apply to some actions via an Action requirement. Unit requirements are +evaluated against the attacker. Unit_Recover Units recover amount extra hitpoints per turn. diff --git a/server/unithand.c b/server/unithand.c index dce4186d7f..d14a618db3 100644 --- a/server/unithand.c +++ b/server/unithand.c @@ -4181,7 +4181,8 @@ static void unit_attack_civilian_casualties(const struct unit *punit, if (pcity && get_target_bonus_effects(NULL, city_owner(pcity), NULL, pcity, NULL, - city_tile(pcity), NULL, NULL, NULL, NULL, + city_tile(pcity), + punit, unit_type_get(punit), NULL, NULL, paction, EFT_UNIT_NO_LOSE_POP) <= 0 && (game.info.killcitizen && uclass_has_flag(unit_class_get(punit), UCF_KILLCITIZEN))) { -- 2.30.2