mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-22 15:43:49 +01:00
Merge pull request #3557 from nickofolas/fix/sleeve-gangs-crash
SLEEVES: Fix issues with Sleeve UI crashing when Sleeve task faction becomes gang faction
This commit is contained in:
commit
11da3106ec
@ -519,6 +519,14 @@ export class Sleeve extends Person {
|
||||
break;
|
||||
}
|
||||
|
||||
// If the player has a gang with the faction the sleeve is working
|
||||
// for, we need to reset the sleeve's task
|
||||
if (p.gang) {
|
||||
if (fac.name === p.gang.facName) {
|
||||
this.resetTaskStatus();
|
||||
}
|
||||
}
|
||||
|
||||
fac.playerReputation += this.getRepGain(p) * cyclesUsed;
|
||||
break;
|
||||
}
|
||||
|
@ -110,6 +110,8 @@ const tasks: {
|
||||
first: factions,
|
||||
second: (s1: string) => {
|
||||
const faction = Factions[s1];
|
||||
if (!faction) return ["------"];
|
||||
|
||||
const facInfo = faction.getInfo();
|
||||
const options: string[] = [];
|
||||
if (facInfo.offerHackingWork) {
|
||||
@ -260,7 +262,7 @@ export function TaskSelector(props: IProps): React.ReactElement {
|
||||
const detailsF = tasks[n];
|
||||
if (detailsF === undefined) throw new Error(`No function for task '${s0}'`);
|
||||
const details = detailsF(props.player, props.sleeve);
|
||||
const details2 = details.second(details.first[0]);
|
||||
const details2 = details.second(details.first[0]) ?? ["------"];
|
||||
setS2(details2[0]);
|
||||
setS1(details.first[0]);
|
||||
setS0(n);
|
||||
|
Loading…
Reference in New Issue
Block a user