mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-26 17:43:48 +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;
|
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;
|
fac.playerReputation += this.getRepGain(p) * cyclesUsed;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -110,6 +110,8 @@ const tasks: {
|
|||||||
first: factions,
|
first: factions,
|
||||||
second: (s1: string) => {
|
second: (s1: string) => {
|
||||||
const faction = Factions[s1];
|
const faction = Factions[s1];
|
||||||
|
if (!faction) return ["------"];
|
||||||
|
|
||||||
const facInfo = faction.getInfo();
|
const facInfo = faction.getInfo();
|
||||||
const options: string[] = [];
|
const options: string[] = [];
|
||||||
if (facInfo.offerHackingWork) {
|
if (facInfo.offerHackingWork) {
|
||||||
@ -260,7 +262,7 @@ export function TaskSelector(props: IProps): React.ReactElement {
|
|||||||
const detailsF = tasks[n];
|
const detailsF = tasks[n];
|
||||||
if (detailsF === undefined) throw new Error(`No function for task '${s0}'`);
|
if (detailsF === undefined) throw new Error(`No function for task '${s0}'`);
|
||||||
const details = detailsF(props.player, props.sleeve);
|
const details = detailsF(props.player, props.sleeve);
|
||||||
const details2 = details.second(details.first[0]);
|
const details2 = details.second(details.first[0]) ?? ["------"];
|
||||||
setS2(details2[0]);
|
setS2(details2[0]);
|
||||||
setS1(details.first[0]);
|
setS1(details.first[0]);
|
||||||
setS0(n);
|
setS0(n);
|
||||||
|
Loading…
Reference in New Issue
Block a user