This commit is contained in:
Olivier Gagnon
2022-07-19 14:21:12 -04:00
parent b409e58447
commit bb8af88b77
15 changed files with 317 additions and 479 deletions
+2 -7
View File
@@ -795,14 +795,9 @@ export function NetscriptSingularity(player: IPlayer, workerScript: WorkerScript
workForCompany: (_ctx: NetscriptContext) =>
function (_companyName: unknown, _focus: unknown = true): boolean {
_ctx.helper.checkSingularityAccess();
let companyName = _ctx.helper.string("companyName", _companyName);
const companyName = _ctx.helper.string("companyName", _companyName);
const focus = _ctx.helper.boolean(_focus);
// Sanitize input
if (companyName == null) {
companyName = player.companyName;
}
// Make sure its a valid company
if (companyName == null || companyName === "" || !(Companies[companyName] instanceof Company)) {
_ctx.log(() => `Invalid company: '${companyName}'`);
@@ -838,7 +833,7 @@ export function NetscriptSingularity(player: IPlayer, workerScript: WorkerScript
player.stopFocusing();
Router.toTerminal();
}
_ctx.log(() => `Began working at '${player.companyName}' as a '${companyPositionName}'`);
_ctx.log(() => `Began working at '${companyName}' as a '${companyPositionName}'`);
return true;
},
applyToCompany: (_ctx: NetscriptContext) =>