summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--airport_gui.c1
-rw-r--r--dock_gui.c1
-rw-r--r--rail_gui.c2
-rw-r--r--road_gui.c1
-rw-r--r--terraform_gui.c1
5 files changed, 6 insertions, 0 deletions
diff --git a/airport_gui.c b/airport_gui.c
index d0194c529..b38e19057 100644
--- a/airport_gui.c
+++ b/airport_gui.c
@@ -126,6 +126,7 @@ static const WindowDesc _air_toolbar_desc = {
void ShowBuildAirToolbar()
{
+ if (_current_player == OWNER_SPECTATOR) return;
DeleteWindowById(WC_BUILD_TOOLBAR, 0);
AllocateWindowDescFront(&_air_toolbar_desc, 0);
}
diff --git a/dock_gui.c b/dock_gui.c
index f7fd23af4..d84547635 100644
--- a/dock_gui.c
+++ b/dock_gui.c
@@ -204,6 +204,7 @@ static const WindowDesc _build_docks_toolbar_desc = {
void ShowBuildDocksToolbar()
{
+ if (_current_player == OWNER_SPECTATOR) return;
DeleteWindowById(WC_BUILD_TOOLBAR, 0);
AllocateWindowDesc(&_build_docks_toolbar_desc);
}
diff --git a/rail_gui.c b/rail_gui.c
index 7958f9f82..34900d604 100644
--- a/rail_gui.c
+++ b/rail_gui.c
@@ -803,6 +803,8 @@ void ShowBuildRailToolbar(int index, int button)
{
Window *w;
+ if (_current_player == OWNER_SPECTATOR) return;
+
// don't recreate the window if we're clicking on a button and the window exists.
if (button < 0 || !(w = FindWindowById(WC_BUILD_TOOLBAR, 0)) || w->wndproc != BuildRailToolbWndProc) {
DeleteWindowById(WC_BUILD_TOOLBAR, 0);
diff --git a/road_gui.c b/road_gui.c
index c87b692a2..263acb168 100644
--- a/road_gui.c
+++ b/road_gui.c
@@ -304,6 +304,7 @@ static const WindowDesc _build_road_desc = {
void ShowBuildRoadToolbar()
{
+ if (_current_player == OWNER_SPECTATOR) return;
DeleteWindowById(WC_BUILD_TOOLBAR, 0);
AllocateWindowDesc(&_build_road_desc);
}
diff --git a/terraform_gui.c b/terraform_gui.c
index 661815779..90773869e 100644
--- a/terraform_gui.c
+++ b/terraform_gui.c
@@ -211,5 +211,6 @@ static const WindowDesc _terraform_desc = {
void ShowTerraformToolbar()
{
+ if (_current_player == OWNER_SPECTATOR) return;
AllocateWindowDescFront(&_terraform_desc, 0);
}