better fix for cores check

This commit is contained in:
Snarling 2022-09-29 00:02:33 -04:00
parent 17be0911b2
commit b682d441e3

@ -308,10 +308,10 @@ const base: InternalAPI<NS> = {
},
growthAnalyzeSecurity:
(ctx: NetscriptContext) =>
(_threads: unknown, _hostname?: unknown, _cores?: unknown): number => {
(_threads: unknown, _hostname?: unknown, _cores: unknown = 1): number => {
let threads = helpers.number(ctx, "threads", _threads);
if (_hostname) {
const cores = _cores ? helpers.number(ctx, "cores", _cores) : 1;
const cores = helpers.number(ctx, "cores", _cores);
const hostname = helpers.string(ctx, "hostname", _hostname);
const server = helpers.getServer(ctx, hostname);