CORPORATION: prevent "Unassigned" as job in setAutoJobAssignment (#308)

This commit is contained in:
zerbosh 2023-01-07 04:28:22 +01:00 committed by GitHub
parent c593d3bce3
commit 65f22e7931
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -608,6 +608,7 @@ export function NetscriptCorporation(): InternalAPI<NSCorporation> {
const job = helpers.string(ctx, "job", _job);
if (!checkEnum(EmployeePositions, job)) throw new Error(`'${job}' is not a valid job.`);
if (job === EmployeePositions.Unassigned) return false;
if (amount < 0 || !Number.isInteger(amount))
throw helpers.makeRuntimeErrorMsg(
ctx,