mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-19 12:45:45 +01:00
BUGFIX: Crash in b1tflum3 and destroyW0r1dD43m0n API (#1619)
This commit is contained in:
parent
329d8ca8e6
commit
be515cc195
@ -30,7 +30,7 @@ export function knowAboutBitverse(): boolean {
|
||||
|
||||
export function getDefaultBitNodeOptions(): BitNodeOptions {
|
||||
return {
|
||||
sourceFileOverrides: new Map<number, number>(),
|
||||
sourceFileOverrides: new JSONMap<number, number>(),
|
||||
intelligenceOverride: undefined,
|
||||
restrictHomePCUpgrade: false,
|
||||
disableGang: false,
|
||||
|
@ -761,7 +761,7 @@ function validateBitNodeOptions(ctx: NetscriptContext, bitNodeOptions: unknown):
|
||||
|
||||
result.sourceFileOverrides = new JSONMap(options.sourceFileOverrides);
|
||||
if (options.intelligenceOverride !== undefined) {
|
||||
result.intelligenceOverride = number(ctx, "intelligenceOverride", options.intelligenceOverride);
|
||||
result.intelligenceOverride = positiveInteger(ctx, "intelligenceOverride", options.intelligenceOverride);
|
||||
} else {
|
||||
result.intelligenceOverride = undefined;
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import { dialogBoxCreate } from "./ui/React/DialogBox";
|
||||
import { Router } from "./ui/GameRoot";
|
||||
import { Page } from "./ui/Router";
|
||||
import { prestigeSourceFile } from "./Prestige";
|
||||
import { setBitNodeOptions } from "./BitNode/BitNodeUtils";
|
||||
import { getDefaultBitNodeOptions, setBitNodeOptions } from "./BitNode/BitNodeUtils";
|
||||
|
||||
function giveSourceFile(bitNodeNumber: number): void {
|
||||
const sourceFileKey = "SourceFile" + bitNodeNumber.toString();
|
||||
@ -69,12 +69,26 @@ export function enterBitNode(
|
||||
Player.bitNodeN = newBitNode;
|
||||
|
||||
// Set BitNode options
|
||||
setBitNodeOptions(bitNodeOptions);
|
||||
try {
|
||||
setBitNodeOptions(bitNodeOptions);
|
||||
} catch (error) {
|
||||
dialogBoxCreate(
|
||||
<>
|
||||
Invalid BitNode options. This is a bug. Please report it to developers.
|
||||
<br />
|
||||
<br />
|
||||
{error instanceof Error ? error.stack : String(error)}
|
||||
</>,
|
||||
);
|
||||
// Use default options
|
||||
setBitNodeOptions(getDefaultBitNodeOptions());
|
||||
}
|
||||
|
||||
prestigeSourceFile(isFlume);
|
||||
|
||||
if (newBitNode === 6) {
|
||||
Router.toPage(Page.BladeburnerCinematic);
|
||||
} else {
|
||||
Router.toPage(Page.Terminal);
|
||||
}
|
||||
prestigeSourceFile(isFlume);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user