Sleeve criming fix (#209)

Also simplify usage of findCrime
This commit is contained in:
Snarling
2022-11-10 11:05:42 -05:00
committed by GitHub
parent 82ba5f1f13
commit 426ad5f296
5 changed files with 7 additions and 12 deletions
+1 -3
View File
@@ -11,8 +11,6 @@ import { isSleeveBladeburnerWork } from "../PersonObjects/Sleeve/Work/SleeveBlad
import { isSleeveFactionWork } from "../PersonObjects/Sleeve/Work/SleeveFactionWork";
import { isSleeveCompanyWork } from "../PersonObjects/Sleeve/Work/SleeveCompanyWork";
import { helpers } from "../Netscript/NetscriptHelpers";
import { Crimes } from "../Crime/Crimes";
import { CrimeType } from "../utils/WorkType";
import { cloneDeep } from "lodash";
export function NetscriptSleeve(): InternalAPI<sleeve> {
@@ -55,7 +53,7 @@ export function NetscriptSleeve(): InternalAPI<sleeve> {
const crimeType = helpers.string(ctx, "crimeType", _crimeType);
checkSleeveAPIAccess(ctx);
checkSleeveNumber(ctx, sleeveNumber);
const crime = checkEnum(CrimeType, crimeType) ? Crimes[crimeType] : findCrime(crimeType);
const crime = findCrime(crimeType);
if (crime == null) return false;
return Player.sleeves[sleeveNumber].commitCrime(crime.type);
},