summaryrefslogtreecommitdiff
path: root/src/openttd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-12-02 14:48:26 +0000
committerrubidium <rubidium@openttd.org>2007-12-02 14:48:26 +0000
commitd9081ad3f5eacf3f788c0246ff9c72eeaea9fd90 (patch)
tree5801e1ae4c02c7813e3235182983acbe0c8c799b /src/openttd.cpp
parent527b72749d5160eceb6e5999c0f329701b14ee47 (diff)
downloadopenttd-d9081ad3f5eacf3f788c0246ff9c72eeaea9fd90.tar.xz
(svn r11556) -Feature: allow setting a default password for new companies in network games.
Diffstat (limited to 'src/openttd.cpp')
-rw-r--r--src/openttd.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp
index 8ebcca502..ffcaeb127 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -724,6 +724,13 @@ static void MakeNewGameDone()
SettingsDisableElrail(_patches.disable_elrails);
SetDefaultRailGui();
+ /* We are the server, we start a new player (not dedicated),
+ * so set the default password *if* needed. */
+ if (_network_server && !StrEmpty(_network_default_company_pass)) {
+ char *password = _network_default_company_pass;
+ NetworkChangeCompanyPassword(1, &password);
+ }
+
MarkWholeScreenDirty();
}