summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/company_cmd.cpp2
-rw-r--r--src/company_manager_face.h7
2 files changed, 6 insertions, 3 deletions
diff --git a/src/company_cmd.cpp b/src/company_cmd.cpp
index 589076b21..101248481 100644
--- a/src/company_cmd.cpp
+++ b/src/company_cmd.cpp
@@ -551,7 +551,7 @@ Company *DoStartupNewCompany(bool is_ai, CompanyID company = INVALID_COMPANY)
c->avail_railtypes = GetCompanyRailtypes(c->index);
c->avail_roadtypes = GetCompanyRoadtypes(c->index);
c->inaugurated_year = _cur_year;
- RandomCompanyManagerFaceBits(c->face, (GenderEthnicity)Random(), false); // create a random company manager face
+ RandomCompanyManagerFaceBits(c->face, (GenderEthnicity)Random(), false, false); // create a random company manager face
SetDefaultCompanySettings(c->index);
diff --git a/src/company_manager_face.h b/src/company_manager_face.h
index a7c2141e7..993e539cc 100644
--- a/src/company_manager_face.h
+++ b/src/company_manager_face.h
@@ -201,12 +201,15 @@ static inline void ScaleAllCompanyManagerFaceBits(CompanyManagerFace &cmf)
* @param cmf the company manager's face to write the bits to
* @param ge the gender and ethnicity of the old company manager's face
* @param adv if it for the advanced company manager's face window
+ * @param interactive is the call from within the user interface?
*
* @pre scale 'ge' to a valid gender/ethnicity combination
*/
-static inline void RandomCompanyManagerFaceBits(CompanyManagerFace &cmf, GenderEthnicity ge, bool adv)
+static inline void RandomCompanyManagerFaceBits(CompanyManagerFace &cmf, GenderEthnicity ge, bool adv, bool interactive = true)
{
- cmf = InteractiveRandom(); // random all company manager's face bits
+ /* This method is called from a command when not interactive and
+ * then we must use Random to get the same result on all clients. */
+ cmf = interactive ? InteractiveRandom() : Random(); // random all company manager's face bits
/* scale ge: 0 == GE_WM, 1 == GE_WF, 2 == GE_BM, 3 == GE_BF (and maybe in future: ...) */
ge = (GenderEthnicity)((uint)ge % GE_END);