mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-21 16:52:55 +02:00
CORPORATION: Add a new API to sell a division (#1210)
Also refactoring around use of "player" variable (whether it is capitalized or not).
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Player as player } from "../Player";
|
||||
import { Player } from "@player";
|
||||
import { calculateServerGrowth, calculateGrowMoney } from "../Server/formulas/grow";
|
||||
import { numCycleForGrowthCorrected } from "../Server/ServerHelpers";
|
||||
import {
|
||||
@@ -62,7 +62,7 @@ import { findCrime } from "../Crime/CrimeHelpers";
|
||||
|
||||
export function NetscriptFormulas(): InternalAPI<IFormulas> {
|
||||
const checkFormulasAccess = function (ctx: NetscriptContext): void {
|
||||
if (!player.hasProgram(CompletedProgramName.formulas)) {
|
||||
if (!Player.hasProgram(CompletedProgramName.formulas)) {
|
||||
throw helpers.errorMessage(ctx, `Requires Formulas.exe to run.`);
|
||||
}
|
||||
};
|
||||
@@ -325,7 +325,7 @@ export function NetscriptFormulas(): InternalAPI<IFormulas> {
|
||||
const upgName = helpers.string(ctx, "upgName", _upgName);
|
||||
const level = helpers.number(ctx, "level", _level);
|
||||
checkFormulasAccess(ctx);
|
||||
const upg = player.hashManager.getUpgrade(upgName);
|
||||
const upg = Player.hashManager.getUpgrade(upgName);
|
||||
if (!upg) {
|
||||
throw helpers.errorMessage(ctx, `Invalid Hash Upgrade: ${upgName}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user