Fix #10154: Don't inconsistently set random company face in network games

(cherry picked from commit 638b75d4763a412085157eea7e09e9d74db268cd)
This commit is contained in:
Tyler Trahan
2022-11-12 07:09:33 -07:00
committed by Jonathan G Rennison
parent 3176313576
commit 1e0d5998db

View File

@@ -586,8 +586,8 @@ Company *DoStartupNewCompany(DoStartupNewCompanyFlag flags, CompanyID company)
c->inaugurated_year = _cur_year; c->inaugurated_year = _cur_year;
/* If starting a player company in singleplayer and a favorite company manager face is selected, choose it. Otherwise, use a random face. /* If starting a player company in singleplayer and a favorite company manager face is selected, choose it. Otherwise, use a random face.
* In a network game, we'll choose the favorite face later in CmdCompanyCtrl to sync it to all clients, but we choose it here for the first (host) company. */ * In a network game, we'll choose the favorite face later in CmdCompanyCtrl to sync it to all clients. */
if (_company_manager_face != 0 && !is_ai) { if (_company_manager_face != 0 && !is_ai && !_networking) {
c->face = _company_manager_face; c->face = _company_manager_face;
} else { } else {
RandomCompanyManagerFaceBits(c->face, (GenderEthnicity)Random(), false, false); RandomCompanyManagerFaceBits(c->face, (GenderEthnicity)Random(), false, false);