Merge pull request #3225 from waffleattack/patch-6

Cap Staneks gift at 25x25 to prevent crashes
This commit is contained in:
hydroflame 2022-03-22 10:37:04 -04:00 committed by GitHub
commit 2edc01776d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

@ -19,14 +19,14 @@ export class StaneksGift implements IStaneksGift {
fragments: ActiveFragment[] = [];
baseSize(): number {
return StanekConstants.BaseSize + BitNodeMultipliers.StaneksGiftExtraSize + Player.sourceFileLvl(13);
return StanekConstants.BaseSize + BitNodeMultipliers.StaneksGiftExtraSize + Player.sourceFileLvl(13)
}
width(): number {
return Math.floor(this.baseSize() / 2 + 1);
return Math.min(Math.floor(this.baseSize() / 2 + 1),StanekConstants.MaxSize);
}
height(): number {
return Math.floor(this.baseSize() / 2 + 0.6);
return Math.min(Math.floor(this.baseSize() / 2 + 0.6),StanekConstants.MaxSize);
}
charge(player: IPlayer, af: ActiveFragment, threads: number): void {

@ -1,7 +1,9 @@
export const StanekConstants: {
RAMBonus: number;
BaseSize: number;
MaxSize: number;
} = {
RAMBonus: 0.1,
BaseSize: 9,
MaxSize: 25
};