Fix #10983: [AdminPort] Correct order of messages
This commit is contained in:

committed by
rubidium42

parent
f20d241e81
commit
49c3215751
@@ -888,6 +888,11 @@ CommandCost CmdCompanyCtrl(DoCommandFlag flags, CompanyCtrlAction cca, CompanyID
|
||||
break;
|
||||
}
|
||||
|
||||
/* Send new companies, before potentially setting the password. Otherwise,
|
||||
* the password update could be sent when the company is not yet known. */
|
||||
NetworkAdminCompanyNew(c);
|
||||
NetworkServerNewCompany(c, ci);
|
||||
|
||||
/* This is the client (or non-dedicated server) who wants a new company */
|
||||
if (client_id == _network_own_client_id) {
|
||||
assert(_local_company == COMPANY_SPECTATOR);
|
||||
@@ -906,8 +911,6 @@ CommandCost CmdCompanyCtrl(DoCommandFlag flags, CompanyCtrlAction cca, CompanyID
|
||||
|
||||
MarkWholeScreenDirty();
|
||||
}
|
||||
|
||||
NetworkServerNewCompany(c, ci);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -923,7 +926,10 @@ CommandCost CmdCompanyCtrl(DoCommandFlag flags, CompanyCtrlAction cca, CompanyID
|
||||
assert(company_id == INVALID_COMPANY || !Company::IsValidID(company_id));
|
||||
|
||||
Company *c = DoStartupNewCompany(true, company_id);
|
||||
if (c != nullptr) NetworkServerNewCompany(c, nullptr);
|
||||
if (c != nullptr) {
|
||||
NetworkAdminCompanyNew(c);
|
||||
NetworkServerNewCompany(c, nullptr);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user