mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-22 23:53:48 +01:00
Prevent awareness and pop going over max
This commit is contained in:
parent
98e8910c3a
commit
e245cc471a
@ -1279,10 +1279,31 @@ export class Industry implements IIndustry {
|
||||
case 1: {
|
||||
//AdVert.Inc,
|
||||
const advMult = corporation.getAdvertisingMultiplier() * this.getAdvertisingMultiplier();
|
||||
this.awareness += 3 * advMult;
|
||||
this.popularity += 1 * advMult;
|
||||
this.awareness *= 1.01 * advMult;
|
||||
this.popularity *= (1 + getRandomInt(1, 3) / 100) * advMult;
|
||||
if (this.awareness === Number.MAX_VALUE || this.awareness + (3 * advMult) > Number.MAX_VALUE) {
|
||||
this.awareness == Number.MAX_VALUE;
|
||||
} else {
|
||||
this.awareness += 3 * advMult;
|
||||
}
|
||||
|
||||
if (this.awareness === Number.MAX_VALUE || this.awareness * (1.01 * advMult) > Number.MAX_VALUE) {
|
||||
this.awareness == Number.MAX_VALUE;
|
||||
} else {
|
||||
this.awareness *= 1.01 * advMult;
|
||||
}
|
||||
|
||||
if (this.popularity === Number.MAX_VALUE || this.popularity + (1 * advMult) > Number.MAX_VALUE) {
|
||||
this.popularity == Number.MAX_VALUE;
|
||||
} else {
|
||||
this.popularity += 1 * advMult;
|
||||
}
|
||||
|
||||
const rand = (1 + getRandomInt(1, 3) / 100);
|
||||
if (this.popularity === Number.MAX_VALUE || this.popularity * (rand * advMult) > Number.MAX_VALUE) {
|
||||
this.popularity == Number.MAX_VALUE;
|
||||
} else {
|
||||
this.popularity *= rand * advMult;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
|
Loading…
Reference in New Issue
Block a user