mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-18 13:43:49 +01:00
Fix setAutoAssignJob parameter validation. (#339)
This commit is contained in:
parent
c1d3664955
commit
d7439aae52
@ -616,10 +616,13 @@ export function NetscriptCorporation(): InternalAPI<NSCorporation> {
|
||||
);
|
||||
|
||||
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);
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user