From 9c41995e59a148d2c76c21ef670e91e5e7f3df78 Mon Sep 17 00:00:00 2001 From: Caldwell <115591472+Caldwell-74@users.noreply.github.com> Date: Tue, 17 Oct 2023 13:07:26 +0200 Subject: [PATCH] increment employees the right way (#869) move the incrementation of employees after the avg calc --- src/Corporation/OfficeSpace.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Corporation/OfficeSpace.ts b/src/Corporation/OfficeSpace.ts index 98031f5b6..b5b4cf0cd 100644 --- a/src/Corporation/OfficeSpace.ts +++ b/src/Corporation/OfficeSpace.ts @@ -179,10 +179,6 @@ export class OfficeSpace { if (this.atCapacity()) return false; if (document.getElementById("cmpy-mgmt-hire-employee-popup") != null) return false; - ++this.numEmployees; - ++this.employeeJobs[position]; - ++this.employeeNextJobs[position]; - this.totalExperience += getRandomInt(50, 100); this.avgMorale = (this.avgMorale * this.numEmployees + getRandomInt(50, 100)) / (this.numEmployees + 1); @@ -192,6 +188,10 @@ export class OfficeSpace { this.avgCharisma = (this.avgCharisma * this.numEmployees + getRandomInt(50, 100)) / (this.numEmployees + 1); this.avgCreativity = (this.avgCreativity * this.numEmployees + getRandomInt(50, 100)) / (this.numEmployees + 1); this.avgEfficiency = (this.avgEfficiency * this.numEmployees + getRandomInt(50, 100)) / (this.numEmployees + 1); + + ++this.numEmployees; + ++this.employeeJobs[position]; + ++this.employeeNextJobs[position]; return true; }