diff --git a/src/PersonObjects/Sleeve/Sleeve.ts b/src/PersonObjects/Sleeve/Sleeve.ts index dedbe38fd..2b931d37f 100644 --- a/src/PersonObjects/Sleeve/Sleeve.ts +++ b/src/PersonObjects/Sleeve/Sleeve.ts @@ -453,11 +453,11 @@ export class Sleeve extends Person { // Reset augs and multipliers this.augmentations = []; this.resetMultipliers(); - + // Reset Location - - this.city=CityName.Sector12; - + + this.city = CityName.Sector12; + // Reset sleeve-related stats this.shock = 1; this.storedCycles = 0; @@ -859,10 +859,8 @@ export class Sleeve extends Person { * Returns boolean indicating success */ workForFaction(p: IPlayer, factionName: string, workType: string): boolean { - if (factionName === "") { - return false; - } - if (!(Factions[factionName] instanceof Faction) || !p.factions.includes(factionName)) { + const faction = Factions[factionName] + if (factionName === "" || !faction || !(faction instanceof Faction) || !p.factions.includes(factionName)) { return false; } @@ -872,7 +870,7 @@ export class Sleeve extends Person { this.resetTaskStatus(); } - const factionInfo = Factions[factionName].getInfo(); + const factionInfo = faction.getInfo(); // Set type of work (hacking/field/security), and the experience gains const sanitizedWorkType: string = workType.toLowerCase();