From c01eeb98400b75faaa3046273b64ea87f7b7881a Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Thu, 26 May 2022 08:43:00 +0300 Subject: [PATCH 32/32] Do not list them all when multiple governments become available If more than one government becomes available at once, just give one notify about multiple governments. Requested by Jacob Nevins See osdn #44677 Signed-off-by: Marko Lindqvist --- server/techtools.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/server/techtools.c b/server/techtools.c index 7ea9b7988b..818aba5912 100644 --- a/server/techtools.c +++ b/server/techtools.c @@ -1455,15 +1455,30 @@ void notify_new_government_options(struct player *pplayer, struct cur_govs_data *data, const char *reason) { + struct government *available = NULL; + governments_iterate(pgov) { if (!data->players[player_index(pplayer)].govs[government_index(pgov)] && can_change_to_government(pplayer, pgov)) { - notify_player(pplayer, NULL, E_NEW_GOVERNMENT, ftc_server, - /* TRANS: "Discovery of " */ - _("%s makes the government form %s" - " available. You may want to start a revolution."), - reason, - government_name_translation(pgov)); + if (available != NULL) { + notify_player(pplayer, NULL, E_NEW_GOVERNMENT, ftc_server, + /* TRANS: "Discovery of " */ + _("%s makes several new government forms" + " available. You may want to start a revolution."), + reason); + return; + } + + available = pgov; } } governments_iterate_end; + + if (available != NULL) { + notify_player(pplayer, NULL, E_NEW_GOVERNMENT, ftc_server, + /* TRANS: "Discovery of " */ + _("%s makes the government form %s" + " available. You may want to start a revolution."), + reason, + government_name_translation(available)); + } } -- 2.35.1