From a47044695a071cedcae33c669c1241850541da66 Mon Sep 17 00:00:00 2001 From: Sveinung Kvilhaugsvik Date: Tue, 11 May 2021 11:43:35 +0200 Subject: [PATCH 3/5] unit_bombs_unit(): take action parameter. Make unit_bombs_unit() aware of what action is being performed. See osdn #42223 --- server/unithand.c | 2 +- server/unittools.c | 3 ++- server/unittools.h | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/server/unithand.c b/server/unithand.c index 71dc623a01..6b069677ac 100644 --- a/server/unithand.c +++ b/server/unithand.c @@ -4223,7 +4223,7 @@ static bool unit_bombard(struct unit *punit, struct tile *ptile, * defenders when bombarding */ } - unit_bombs_unit(punit, pdefender, &att_hp, &def_hp); + unit_bombs_unit(punit, pdefender, &att_hp, &def_hp, paction); notify_player(pplayer, ptile, E_UNIT_WIN_ATT, ftc_server, diff --git a/server/unittools.c b/server/unittools.c index 0c1fccc456..a1eaf4b776 100644 --- a/server/unittools.c +++ b/server/unittools.c @@ -326,7 +326,8 @@ void unit_versus_unit(struct unit *attacker, struct unit *defender, 2) Do rate attacks and don't kill the defender, then return. **************************************************************************/ void unit_bombs_unit(struct unit *attacker, struct unit *defender, - int *att_hp, int *def_hp) + int *att_hp, int *def_hp, + const struct action *paction) { int i; int rate = unit_type_get(attacker)->bombard_rate; diff --git a/server/unittools.h b/server/unittools.h index cf55ba48f7..2d6d37e688 100644 --- a/server/unittools.h +++ b/server/unittools.h @@ -79,7 +79,8 @@ void notify_unit_experience(struct unit *punit); void unit_versus_unit(struct unit *attacker, struct unit *defender, int *att_hp, int *def_hp); void unit_bombs_unit(struct unit *attacker, struct unit *defender, - int *att_hp, int *def_hp); + int *att_hp, int *def_hp, + const struct action *paction); void combat_veterans(struct unit *attacker, struct unit *defender); /* move check related */ -- 2.30.2