summaryrefslogtreecommitdiff
path: root/src/company_manager_face.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2013-06-27 20:20:13 +0000
committerrubidium <rubidium@openttd.org>2013-06-27 20:20:13 +0000
commit11e6d5c8dfe42215d07c539393e03ed13614891e (patch)
tree32f47ac611e734060030389368baaa33a07f0047 /src/company_manager_face.h
parent868001a1e0f145b29af154da09a939c37f0f5a51 (diff)
downloadopenttd-11e6d5c8dfe42215d07c539393e03ed13614891e.tar.xz
(svn r25490) -Fix [FS#5610]: the face of the manager differed on clients when the company was started after the clients joined
Diffstat (limited to 'src/company_manager_face.h')
-rw-r--r--src/company_manager_face.h7
1 files changed, 5 insertions, 2 deletions
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);