From 7a5a36c70be489cfd0379b5ea6e02574b674388e Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Fri, 14 Oct 2022 23:09:10 +0300 Subject: [PATCH 44/44] Qt: Make targetless revolution insensitive when impossible See osdn #45782 Signed-off-by: Marko Lindqvist --- client/gui-qt/menu.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/gui-qt/menu.cpp b/client/gui-qt/menu.cpp index ae52515176..5e3485e150 100644 --- a/client/gui-qt/menu.cpp +++ b/client/gui-qt/menu.cpp @@ -632,7 +632,7 @@ void gov_menu::update() gov_count = government_count(); revol_gov = game.government_during_revolution; - for (i = 0, j = 0; i < gov_count; ++i) { + for (i = 0, j = 0; i < gov_count; i++) { gov = government_by_number(i); if (gov != revol_gov) { // Skip revolution goverment sprite = get_government_sprite(tileset, gov); @@ -641,9 +641,10 @@ void gov_menu::update() } actions[j + 1]->setEnabled( can_change_to_government(client.conn.playing, gov)); - ++j; + j++; } else { - actions[0]->setEnabled(!client_is_observer()); + actions[0]->setEnabled(!client_is_observer() + && untargeted_revolution_allowed()); } } } -- 2.35.1