From 61bd8a28df40cec60734bfca856d492bb081fe48 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Fri, 9 Sep 2022 23:02:16 +0300 Subject: [PATCH 46/46] Count units lost due to shield upkeep to score.units_lost Reported by ihnatus See osdn #44887 Signed-off-by: Marko Lindqvist --- server/cityturn.c | 2 +- server/unittools.c | 1 + server/unittools.h | 75 ++++++++++++++++++++++++---------------------- 3 files changed, 41 insertions(+), 37 deletions(-) diff --git a/server/cityturn.c b/server/cityturn.c index 0adb05b895..94d5be36e5 100644 --- a/server/cityturn.c +++ b/server/cityturn.c @@ -2280,7 +2280,7 @@ static bool city_distribute_surplus_shields(struct player *pplayer, /* TODO: Should the unit try to help cities on adjacent tiles? That * would be a rules change. (This action is performed by the game * it self) */ - if (upkeep_kill_unit(punit, O_SHIELD, ULR_DISBANDED, + if (upkeep_kill_unit(punit, O_SHIELD, ULR_UPKEEP, game.info.muuk_shield_wipe)) { notify_player(pplayer, city_tile(pcity), E_UNIT_LOST_MISC, ftc_server, diff --git a/server/unittools.c b/server/unittools.c index 8f41104dd0..a7c897e966 100644 --- a/server/unittools.c +++ b/server/unittools.c @@ -2039,6 +2039,7 @@ static void wipe_unit_full(struct unit *punit, bool transported, case ULR_BARB_UNLEASH: case ULR_CITY_LOST: case ULR_STARVED: + case ULR_UPKEEP: case ULR_NONNATIVE_TERR: case ULR_ARMISTICE: case ULR_HP_LOSS: diff --git a/server/unittools.h b/server/unittools.h index 02f30567d7..038f5f89da 100644 --- a/server/unittools.h +++ b/server/unittools.h @@ -33,42 +33,45 @@ #define SPECENUM_VALUE5NAME "starved" #define SPECENUM_VALUE6 ULR_SOLD #define SPECENUM_VALUE6NAME "sold" -#define SPECENUM_VALUE7 ULR_USED -#define SPECENUM_VALUE7NAME "used" -#define SPECENUM_VALUE8 ULR_EXECUTED -#define SPECENUM_VALUE8NAME "executed" -#define SPECENUM_VALUE9 ULR_ELIMINATED -#define SPECENUM_VALUE9NAME "eliminated" -#define SPECENUM_VALUE10 ULR_EDITOR -#define SPECENUM_VALUE10NAME "editor" -#define SPECENUM_VALUE11 ULR_NONNATIVE_TERR -#define SPECENUM_VALUE11NAME "nonnative_terr" -#define SPECENUM_VALUE12 ULR_PLAYER_DIED -#define SPECENUM_VALUE12NAME "player_died" -#define SPECENUM_VALUE13 ULR_ARMISTICE -#define SPECENUM_VALUE13NAME "armistice" -#define SPECENUM_VALUE14 ULR_SDI -#define SPECENUM_VALUE14NAME "sdi" -#define SPECENUM_VALUE15 ULR_DETONATED -#define SPECENUM_VALUE15NAME "detonated" -#define SPECENUM_VALUE16 ULR_MISSILE -#define SPECENUM_VALUE16NAME "missile" -#define SPECENUM_VALUE17 ULR_NUKE -#define SPECENUM_VALUE17NAME "nuke" -#define SPECENUM_VALUE18 ULR_HP_LOSS -#define SPECENUM_VALUE18NAME "hp_loss" -#define SPECENUM_VALUE19 ULR_FUEL -#define SPECENUM_VALUE19NAME "fuel" -#define SPECENUM_VALUE20 ULR_STACK_CONFLICT -#define SPECENUM_VALUE20NAME "stack_conflict" -#define SPECENUM_VALUE21 ULR_BRIBED -#define SPECENUM_VALUE21NAME "bribed" -#define SPECENUM_VALUE22 ULR_CAPTURED -#define SPECENUM_VALUE22NAME "captured" -#define SPECENUM_VALUE23 ULR_CAUGHT -#define SPECENUM_VALUE23NAME "caught" -#define SPECENUM_VALUE24 ULR_TRANSPORT_LOST -#define SPECENUM_VALUE24NAME "transport_lost" +/* Upkeep other than one of the above ones */ +#define SPECENUM_VALUE7 ULR_UPKEEP +#define SPECENUM_VALUE7NAME "upkeep" +#define SPECENUM_VALUE8 ULR_USED +#define SPECENUM_VALUE8NAME "used" +#define SPECENUM_VALUE9 ULR_EXECUTED +#define SPECENUM_VALUE9NAME "executed" +#define SPECENUM_VALUE10 ULR_ELIMINATED +#define SPECENUM_VALUE10NAME "eliminated" +#define SPECENUM_VALUE11 ULR_EDITOR +#define SPECENUM_VALUE11NAME "editor" +#define SPECENUM_VALUE12 ULR_NONNATIVE_TERR +#define SPECENUM_VALUE12NAME "nonnative_terr" +#define SPECENUM_VALUE13 ULR_PLAYER_DIED +#define SPECENUM_VALUE13NAME "player_died" +#define SPECENUM_VALUE14 ULR_ARMISTICE +#define SPECENUM_VALUE14NAME "armistice" +#define SPECENUM_VALUE15 ULR_SDI +#define SPECENUM_VALUE15NAME "sdi" +#define SPECENUM_VALUE16 ULR_DETONATED +#define SPECENUM_VALUE16NAME "detonated" +#define SPECENUM_VALUE17 ULR_MISSILE +#define SPECENUM_VALUE17NAME "missile" +#define SPECENUM_VALUE18 ULR_NUKE +#define SPECENUM_VALUE18NAME "nuke" +#define SPECENUM_VALUE19 ULR_HP_LOSS +#define SPECENUM_VALUE19NAME "hp_loss" +#define SPECENUM_VALUE20 ULR_FUEL +#define SPECENUM_VALUE20NAME "fuel" +#define SPECENUM_VALUE21 ULR_STACK_CONFLICT +#define SPECENUM_VALUE21NAME "stack_conflict" +#define SPECENUM_VALUE22 ULR_BRIBED +#define SPECENUM_VALUE22NAME "bribed" +#define SPECENUM_VALUE23 ULR_CAPTURED +#define SPECENUM_VALUE23NAME "captured" +#define SPECENUM_VALUE24 ULR_CAUGHT +#define SPECENUM_VALUE24NAME "caught" +#define SPECENUM_VALUE25 ULR_TRANSPORT_LOST +#define SPECENUM_VALUE25NAME "transport_lost" #include "specenum_gen.h" /* battle related */ -- 2.35.1