From 77fb766afd035d6ae92895d17365adca6f562b22 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 8 May 2022 06:21:36 +0300 Subject: [PATCH 59/59] Correct counting of units killed with the stack Unreachable units that were not really killed were included in the count reported to the player. Reported by Lexxie See osdn #44416 Signed-off-by: Marko Lindqvist --- server/unittools.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/unittools.c b/server/unittools.c index aac875da09..fd73a874a3 100644 --- a/server/unittools.c +++ b/server/unittools.c @@ -2226,8 +2226,9 @@ void kill_unit(struct unit *pkiller, struct unit *punit, bool vet) if (unitcount == 0) { unit_list_iterate(deftile->units, vunit) { - if (pplayers_at_war(pvictor, unit_owner(vunit))) { - unitcount++; + if (pplayers_at_war(pvictor, unit_owner(vunit)) + && is_unit_reachable_at(vunit, pkiller, deftile)) { + unitcount++; } } unit_list_iterate_end; } -- 2.35.1