crime consume all their time at once

This commit is contained in:
Olivier Gagnon 2022-07-21 14:36:29 -04:00
parent e55a3f39d4
commit e9254edf5d
3 changed files with 3 additions and 3 deletions

2
dist/main.bundle.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -35,7 +35,7 @@ export class CrimeWork extends Work {
this.cyclesWorked += cycles;
const time = Object.values(Crimes).find((c) => c.type === this.crimeType)?.time ?? 0;
this.unitCompleted += CONSTANTS._idleSpeed * cycles;
if (this.unitCompleted >= time) {
while (this.unitCompleted >= time) {
this.commit(player);
this.unitCompleted -= time;
}