From fcca4f82ec7112bdfa55db331ce4d869324c393c Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 2 Jul 2022 17:15:42 +0300 Subject: [PATCH 22/22] helpdata.c: Check if building-enabled nuke has tech requirement Don't just assume that there's a tech requirement to show. See #44941 Signed-off-by: Marko Lindqvist --- client/helpdata.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/client/helpdata.c b/client/helpdata.c index 33b6fb95f8..0c07d467d0 100644 --- a/client/helpdata.c +++ b/client/helpdata.c @@ -1317,13 +1317,20 @@ char *helptext_building(char *buf, size_t bufsz, struct player *pplayer, && num_role_units(action_id_get_role(ACTION_NUKE)) > 0) { struct unit_type *u = get_role_unit(action_id_get_role(ACTION_NUKE), 0); - cat_snprintf(buf, bufsz, - /* TRANS: 'Allows all players with knowledge of atomic - * power to build nuclear units.' */ - _("* Allows all players with knowledge of %s " - "to build %s units.\n"), - advance_name_translation(u->require_advance), - utype_name_translation(u)); + if (advance_number(u->require_advance) != A_NONE) { + cat_snprintf(buf, bufsz, + /* TRANS: 'Allows all players with knowledge of atomic + * power to build nuclear units.' */ + _("* Allows all players with knowledge of %s " + "to build %s units.\n"), + advance_name_translation(u->require_advance), + utype_name_translation(u)); + } else { + cat_snprintf(buf, bufsz, + /* TRANS: 'Allows all players to build nuclear units.' */ + _("* Allows all players to build %s units.\n"), + utype_name_translation(u)); + } } insert_allows(&source, buf + strlen(buf), bufsz - strlen(buf), -- 2.35.1