mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-20 13:15:48 +01:00
increment employees the right way (#869)
move the incrementation of employees after the avg calc
This commit is contained in:
parent
ad03e4ee82
commit
9c41995e59
@ -179,10 +179,6 @@ export class OfficeSpace {
|
|||||||
if (this.atCapacity()) return false;
|
if (this.atCapacity()) return false;
|
||||||
if (document.getElementById("cmpy-mgmt-hire-employee-popup") != null) 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.totalExperience += getRandomInt(50, 100);
|
||||||
|
|
||||||
this.avgMorale = (this.avgMorale * this.numEmployees + getRandomInt(50, 100)) / (this.numEmployees + 1);
|
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.avgCharisma = (this.avgCharisma * this.numEmployees + getRandomInt(50, 100)) / (this.numEmployees + 1);
|
||||||
this.avgCreativity = (this.avgCreativity * 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.avgEfficiency = (this.avgEfficiency * this.numEmployees + getRandomInt(50, 100)) / (this.numEmployees + 1);
|
||||||
|
|
||||||
|
++this.numEmployees;
|
||||||
|
++this.employeeJobs[position];
|
||||||
|
++this.employeeNextJobs[position];
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user