summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2004-12-20 16:15:19 +0000
committertruelight <truelight@openttd.org>2004-12-20 16:15:19 +0000
commitc1ab4b58e3b3c1d18b96ed4cfff0712fee6c2d92 (patch)
tree0e94177ee0d1dfc7f4dba0975d27e570fbca6b91
parent9938d19d76f4e5cffe727ce46b4bdef59c813ce7 (diff)
downloadopenttd-c1ab4b58e3b3c1d18b96ed4cfff0712fee6c2d92.tar.xz
(svn r1187) -Fix: [Network] You can no longer join as spectator a game with no
companies (a lot of code can simply not handle it)
-rw-r--r--network_gui.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/network_gui.c b/network_gui.c
index 8bb3f01f6..809511b87 100644
--- a/network_gui.c
+++ b/network_gui.c
@@ -643,6 +643,10 @@ static void NetworkLobbyWindowWndProc(Window *w, WindowEvent *e)
if (_network_lobby_company_count == MAX_PLAYERS)
w->disabled_state |= (1<<8);
+ /* You can not join a server as spectator when it has no companies active..
+ it causes some nasty crashes */
+ if (_network_lobby_company_count == 0)
+ w->disabled_state |= (1<<9);
DrawWindowWidgets(w);