diff --git a/src/NetscriptFunctions/Corporation.ts b/src/NetscriptFunctions/Corporation.ts index 7ed573794..5b11d7f93 100644 --- a/src/NetscriptFunctions/Corporation.ts +++ b/src/NetscriptFunctions/Corporation.ts @@ -616,10 +616,13 @@ export function NetscriptCorporation(): InternalAPI { ); const office = getOffice(divisionName, cityName); - if (office.employeeJobs[EmployeePositions.Unassigned] < amount) + + const totalNewEmployees = amount - office.employeeNextJobs[job]; + + if (office.employeeNextJobs[EmployeePositions.Unassigned] < totalNewEmployees) throw helpers.makeRuntimeErrorMsg( ctx, - `Tried to assign more Employees to '${job}' than are unassigned. Amount:'${amount}'`, + `Unable to bring '${job} employees to ${amount}. Requires ${totalNewEmployees} unassigned employees`, ); return AutoAssignJob(office, job, amount); },