Project

General

Profile

Bug #1693 » 1693.patch

John Robertson, 09/23/2025 10:19 AM

View differences:

server/advisors/advgoto.c
enum unit_activity activity = punit->activity;
struct extra_type *tgt = punit->activity_target;
bool alive;
int unit_id = punit->id;
if (punit->moves_left <= 0) {
return TRUE;
......
punit->goto_tile = ptile;
unit_activity_handling(punit, ACTIVITY_GOTO, ACTION_NONE);
alive = adv_unit_execute_path(punit, path);
alive = adv_unit_execute_path(punit, path) && unit_is_alive(unit_id);
if (alive) {
if (activity != ACTIVITY_GOTO) {
server/unithand.c
punit->moved = TRUE; /* We moved */
/* Now that dead defender is certainly no longer listed as unit
* supported by the city, we may even remove the city
* (if it shrinks from size 1) */
pcity = tile_city(def_tile);
if (pcity != nullptr) {
unit_attack_civilian_casualties(punit, pcity, paction, "attack");
}
if (paction->result == ACTRES_COLLECT_RANSOM) {
collect_ransom(pwinner, ploser,
vet && !utype_is_consumed_by_action(paction, punit->utype));
......
vet && !utype_is_consumed_by_action(paction, punit->utype));
}
/* Now that dead defender is certainly no longer listed as unit
* supported by the city, we may even remove the city
* (if it shrinks from size 1) */
pcity = tile_city(def_tile);
if (pcity != nullptr) {
unit_attack_civilian_casualties(punit, pcity, paction, "attack");
}
if (unit_is_alive(winner_id)) {
if (utype_is_consumed_by_action(paction, pwinner->utype)) {
return TRUE;
(1-1/2)