mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-23 01:32:55 +02:00
Fix bug with sleeve.setToFactionWork
Function was not checking that the player was actually in the faction, which allowed sleeves to work for factions the player was not part of.
This commit is contained in:
@@ -25,6 +25,7 @@ import {
|
||||
LocationName,
|
||||
UniversityClassType,
|
||||
CompanyName,
|
||||
FactionName,
|
||||
} from "@enums";
|
||||
|
||||
import { Factions } from "../../Faction/Factions";
|
||||
@@ -291,15 +292,13 @@ export class Sleeve extends Person implements SleevePerson {
|
||||
}
|
||||
|
||||
/** TODO 2.4: Make this take in type correct data */
|
||||
workForFaction(_factionName: string, _workType: string): boolean {
|
||||
workForFaction(factionName: FactionName, _workType: string): boolean {
|
||||
const workTypeConversion: Record<string, string> = {
|
||||
"Hacking Contracts": "hacking",
|
||||
"Field Work": "field",
|
||||
"Security Work": "security",
|
||||
};
|
||||
if (workTypeConversion[_workType]) _workType = workTypeConversion[_workType];
|
||||
const factionName = getEnumHelper("FactionName").fuzzyGetMember(_factionName);
|
||||
if (!factionName) return false;
|
||||
const faction = Factions[factionName];
|
||||
const workType = getEnumHelper("FactionWorkType").fuzzyGetMember(_workType);
|
||||
if (!workType) return false;
|
||||
|
||||
Reference in New Issue
Block a user