diff --git a/src/NetscriptFunctions/Singularity.ts b/src/NetscriptFunctions/Singularity.ts index c35e2fa03..f11213d79 100644 --- a/src/NetscriptFunctions/Singularity.ts +++ b/src/NetscriptFunctions/Singularity.ts @@ -611,11 +611,7 @@ export function NetscriptSingularity(): InternalAPI { }, hospitalize: (ctx) => () => { helpers.checkSingularityAccess(ctx); - if (Player.currentWork || Router.page() === Page.Infiltration || Router.page() === Page.BitVerse) { - helpers.log(ctx, () => "Cannot go to the hospital because the player is busy."); - return; - } - Player.hospitalize(); + Player.hospitalize(true); }, isBusy: (ctx) => () => { helpers.checkSingularityAccess(ctx); diff --git a/src/PersonObjects/Player/PlayerObjectGeneralMethods.ts b/src/PersonObjects/Player/PlayerObjectGeneralMethods.ts index ac00f6532..32246477a 100644 --- a/src/PersonObjects/Player/PlayerObjectGeneralMethods.ts +++ b/src/PersonObjects/Player/PlayerObjectGeneralMethods.ts @@ -256,19 +256,20 @@ export function takeDamage(this: PlayerObject, amt: number): boolean { this.hp.current -= amt; if (this.hp.current <= 0) { - this.hospitalize(); + this.hospitalize(false); return true; } else { return false; } } -export function hospitalize(this: PlayerObject): number { +export function hospitalize(this: PlayerObject, suppressNotification: boolean): number { const cost = getHospitalizationCost(); - SnackbarEvents.emit(`You've been Hospitalized for ${formatMoney(cost)}`, ToastVariant.SUCCESS, 2000); - this.loseMoney(cost, "hospitalization"); this.hp.current = this.hp.max; + if (!suppressNotification) { + SnackbarEvents.emit(`You've been Hospitalized for ${formatMoney(cost)}`, ToastVariant.SUCCESS, 2000); + } return cost; }