summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorplanetmaker <planetmaker@openttd.org>2014-05-25 19:01:30 +0000
committerplanetmaker <planetmaker@openttd.org>2014-05-25 19:01:30 +0000
commit105306609f967fbaf8342d1fb799a98d439a1a8f (patch)
tree717fa10ca04c523d2fbb59bf56fd70536d378df4 /src
parent3330e09b68e11378852507e34e205ed621b1f23b (diff)
downloadopenttd-105306609f967fbaf8342d1fb799a98d439a1a8f.tar.xz
(svn r26616) -Fix (r26576) [FS#6025]: First send packages about new company, then clients joining it to admin port (Taede)
Diffstat (limited to 'src')
-rw-r--r--src/network/network_server.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp
index 9ac1a03aa..dc18658a9 100644
--- a/src/network/network_server.cpp
+++ b/src/network/network_server.cpp
@@ -2193,11 +2193,17 @@ void NetworkServerNewCompany(const Company *c, NetworkClientInfo *ci)
ci->client_playas = c->index;
NetworkUpdateClientInfo(ci->client_id);
NetworkSendCommand(0, 0, 0, CMD_RENAME_PRESIDENT, NULL, ci->client_name, c->index);
- NetworkServerSendChat(NETWORK_ACTION_COMPANY_NEW, DESTTYPE_BROADCAST, 0, "", ci->client_id, c->index + 1);
}
/* Announce new company on network. */
NetworkAdminCompanyInfo(c, true);
+
+ if (ci != NULL) {
+ /* ci is NULL when replaying, or for AIs. In neither case there is a client.
+ We need to send Admin port update here so that they first know about the new company
+ and then learn about a possibly joining client (see FS#6025) */
+ NetworkServerSendChat(NETWORK_ACTION_COMPANY_NEW, DESTTYPE_BROADCAST, 0, "", ci->client_id, c->index + 1);
+ }
}
#endif /* ENABLE_NETWORK */