From abdc786403d9486316d93259f108992bee5507ac Mon Sep 17 00:00:00 2001 From: pigalot Date: Thu, 13 Jan 2022 17:55:56 +0000 Subject: [PATCH] prevent DreamSense from pushing over max --- src/Corporation/Industry.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Corporation/Industry.ts b/src/Corporation/Industry.ts index 2c271b9c7..09dbd03b3 100644 --- a/src/Corporation/Industry.ts +++ b/src/Corporation/Industry.ts @@ -435,8 +435,17 @@ export class Industry implements IIndustry { const popularityGain = corporation.getDreamSenseGain(), awarenessGain = popularityGain * 4; if (popularityGain > 0) { - this.popularity += popularityGain * marketCycles; - this.awareness += awarenessGain * marketCycles; + if (this.awareness === Number.MAX_VALUE || this.awareness + (awarenessGain * marketCycles) > Number.MAX_VALUE) { + this.awareness == Number.MAX_VALUE; + } else { + this.awareness += awarenessGain * marketCycles; + } + + if (this.popularity === Number.MAX_VALUE || this.popularity + (popularityGain * marketCycles) > Number.MAX_VALUE) { + this.popularity == Number.MAX_VALUE; + } else { + this.popularity += popularityGain * marketCycles; + } } return;