summaryrefslogtreecommitdiff
path: root/town_gui.c
diff options
context:
space:
mode:
authordarkvater <darkvater@openttd.org>2005-01-04 19:49:44 +0000
committerdarkvater <darkvater@openttd.org>2005-01-04 19:49:44 +0000
commitf2b8e00eddc7e9e6302d50fd674b1c9a233834b8 (patch)
tree4e76ad064b018a8dc253abe2a31320d27199c299 /town_gui.c
parent522d6b590c961d107ed0f03ec83c7d32e9181c91 (diff)
downloadopenttd-f2b8e00eddc7e9e6302d50fd674b1c9a233834b8.tar.xz
(svn r1377) -Fix: only a server can rename a town in a MP game
Diffstat (limited to 'town_gui.c')
-rw-r--r--town_gui.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/town_gui.c b/town_gui.c
index 5c44d9703..946dbec48 100644
--- a/town_gui.c
+++ b/town_gui.c
@@ -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 @@ static void TownViewWndProc(Window *w, WindowEvent *e)
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);