(svn r1377) -Fix: only a server can rename a town in a MP game
authordarkvater
Tue, 04 Jan 2005 19:49:44 +0000
changeset 891 b701cd0b20ae
parent 890 a39ee70d9886
child 892 3e5dd4c4d5b3
(svn r1377) -Fix: only a server can rename a town in a MP game
town_gui.c
--- a/town_gui.c	Tue Jan 04 17:54:16 2005 +0000
+++ b/town_gui.c	Tue Jan 04 19:49:44 2005 +0000
@@ -8,6 +8,7 @@
 #include "gui.h"
 #include "command.h"
 #include "player.h"
+#include "network.h"
 
 static const Widget _town_authority_widgets[] = {
 {    WWT_TEXTBTN,   RESIZE_NONE,    13,     0,    10,     0,    13, STR_00C5,				STR_018B_CLOSE_WINDOW},
@@ -227,6 +228,9 @@
 
 	switch(e->event) {
 	case WE_PAINT:
+		// disable renaming town in network games if you are not the server
+		if (_networking && !_network_server) SETBIT(w->disabled_state, 8);
+
 		SetDParam(0, t->index);
 		DrawWindowWidgets(w);