diff --git a/airport_gui.c b/airport_gui.c index d0194c5292..b38e190574 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 f7fd23af4a..d845476359 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 7958f9f82d..34900d6045 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 c87b692a23..263acb1685 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 661815779c..90773869ee 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); }