BUGFIX: SleeveCrimeWork.ts works through all cyclesWorked if its greater than cyclesNeeded (#881)

This commit is contained in:
TheAimMan 2023-10-23 05:31:11 -04:00 committed by GitHub
parent 5d266e01a6
commit 848fc9905a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -38,6 +38,7 @@ export class SleeveCrimeWork extends SleeveWorkClass {
this.cyclesWorked += cycles; this.cyclesWorked += cycles;
if (this.cyclesWorked < this.cyclesNeeded()) return; if (this.cyclesWorked < this.cyclesNeeded()) return;
while (this.cyclesWorked > this.cyclesNeeded()) {
const crime = this.getCrime(); const crime = this.getCrime();
const gains = this.getExp(sleeve); const gains = this.getExp(sleeve);
const success = Math.random() < crime.successRate(sleeve); const success = Math.random() < crime.successRate(sleeve);
@ -48,6 +49,7 @@ export class SleeveCrimeWork extends SleeveWorkClass {
applySleeveGains(sleeve, gains, success ? 1 : 0.25); applySleeveGains(sleeve, gains, success ? 1 : 0.25);
this.cyclesWorked -= this.cyclesNeeded(); this.cyclesWorked -= this.cyclesNeeded();
} }
}
APICopy() { APICopy() {
return { return {