Project

General

Profile

Bug #1867 » 0070-gtk-Fix-flagless-unit-crash-on-action-selection-dial.patch

main - Marko Lindqvist, 01/10/2026 02:50 AM

View differences:

client/gui-gtk-3.22/action_dialog.c
_("Your %s has arrived at %s.\nWhat is your command?"),
unit_name_translation(actor_unit),
city_name_get(target_city));
} else if (target_unit) {
astr_set(&text,
/* TRANS: Your Spy is ready to act against Roman Freight. */
_("Your %s is ready to act against %s %s."),
unit_name_translation(actor_unit),
nation_adjective_for_player(unit_owner(target_unit)),
unit_name_translation(target_unit));
} else if (target_unit != nullptr) {
struct player *owner = unit_owner(target_unit);
if (owner != nullptr) {
astr_set(&text,
/* TRANS: Your Spy is ready to act against Roman Freight. */
_("Your %s is ready to act against %s %s."),
unit_name_translation(actor_unit),
nation_adjective_for_player(unit_owner(target_unit)),
unit_name_translation(target_unit));
} else {
/* Flagless unit */
astr_set(&text,
/* TRANS: Your Spy is ready to act against Freight. */
_("Your %s is ready to act against %s."),
unit_name_translation(actor_unit),
unit_name_translation(target_unit));
}
} else {
fc_assert_msg(target_unit || target_city || target_tile,
"No target specified.");
client/gui-gtk-4.0/action_dialog.c
_("Your %s has arrived at %s.\nWhat is your command?"),
unit_name_translation(actor_unit),
city_name_get(target_city));
} else if (target_unit) {
astr_set(&text,
/* TRANS: Your Spy is ready to act against Roman Freight. */
_("Your %s is ready to act against %s %s."),
unit_name_translation(actor_unit),
nation_adjective_for_player(unit_owner(target_unit)),
unit_name_translation(target_unit));
} else if (target_unit != nullptr) {
struct player *owner = unit_owner(target_unit);
if (owner != nullptr) {
astr_set(&text,
/* TRANS: Your Spy is ready to act against Roman Freight. */
_("Your %s is ready to act against %s %s."),
unit_name_translation(actor_unit),
nation_adjective_for_player(unit_owner(target_unit)),
unit_name_translation(target_unit));
} else {
/* Flagless unit */
astr_set(&text,
/* TRANS: Your Spy is ready to act against Freight. */
_("Your %s is ready to act against %s."),
unit_name_translation(actor_unit),
unit_name_translation(target_unit));
}
} else {
fc_assert_msg(target_unit || target_city || target_tile,
"No target specified.");
client/gui-gtk-5.0/action_dialog.c
_("Your %s has arrived at %s.\nWhat is your command?"),
unit_name_translation(actor_unit),
city_name_get(target_city));
} else if (target_unit) {
astr_set(&text,
/* TRANS: Your Spy is ready to act against Roman Freight. */
_("Your %s is ready to act against %s %s."),
unit_name_translation(actor_unit),
nation_adjective_for_player(unit_owner(target_unit)),
unit_name_translation(target_unit));
} else if (target_unit != nullptr) {
struct player *owner = unit_owner(target_unit);
if (owner != nullptr) {
astr_set(&text,
/* TRANS: Your Spy is ready to act against Roman Freight. */
_("Your %s is ready to act against %s %s."),
unit_name_translation(actor_unit),
nation_adjective_for_player(unit_owner(target_unit)),
unit_name_translation(target_unit));
} else {
/* Flagless unit */
astr_set(&text,
/* TRANS: Your Spy is ready to act against Freight. */
_("Your %s is ready to act against %s."),
unit_name_translation(actor_unit),
unit_name_translation(target_unit));
}
} else {
fc_assert_msg(target_unit || target_city || target_tile,
"No target specified.");
(1-1/2)