(svn r3414) - Fix: Disable the Fund New Industry menu item and window when connected to a server as a spectator.
authorpeter1138
Sat, 21 Jan 2006 21:45:34 +0000
changeset 2866 23cf6ec995b1
parent 2865 97cb78a1d02c
child 2867 91ee491df4ec
(svn r3414) - Fix: Disable the Fund New Industry menu item and window when connected to a server as a spectator.
industry_gui.c
main_gui.c
--- a/industry_gui.c	Sat Jan 21 20:34:17 2006 +0000
+++ b/industry_gui.c	Sat Jan 21 21:45:34 2006 +0000
@@ -267,6 +267,7 @@
 
 void ShowBuildIndustryWindow(void)
 {
+	if (_current_player == OWNER_SPECTATOR) return;
 	AllocateWindowDescFront(_industry_window_desc[_patches.build_rawmaterial_ind][_opt_ptr->landscape],0);
 }
 
--- a/main_gui.c	Sat Jan 21 20:34:17 2006 +0000
+++ b/main_gui.c	Sat Jan 21 21:45:34 2006 +0000
@@ -791,7 +791,8 @@
 
 static void ToolbarIndustryClick(Window *w)
 {
-	PopupMainToolbMenu(w, 280, 12, STR_INDUSTRY_DIR, 2, 0);
+	int dis = _current_player == OWNER_SPECTATOR ? 2 : 0;
+	PopupMainToolbMenu(w, 280, 12, STR_INDUSTRY_DIR, 2, dis);
 }
 
 static void ToolbarTrainClick(Window *w)