mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-18 20:25:45 +01:00
Prevent faction invitations appearing after prestige (#872)
This commit is contained in:
parent
71e37823dd
commit
36a8b35cfb
@ -7,7 +7,7 @@ import { EventEmitter } from "../../utils/EventEmitter";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import Button from "@mui/material/Button";
|
||||
|
||||
export const InvitationEvent = new EventEmitter<[Faction]>();
|
||||
export const InvitationEvent = new EventEmitter<[Faction | null]>();
|
||||
|
||||
export function InvitationModal({ hidden }: { hidden: boolean }): React.ReactElement {
|
||||
const [faction, setFaction] = useState<Faction | null>(null);
|
||||
@ -17,8 +17,9 @@ export function InvitationModal({ hidden }: { hidden: boolean }): React.ReactEle
|
||||
const i = Player.factionInvitations.findIndex((facName) => facName === faction.name);
|
||||
if (i === -1) {
|
||||
console.error("Could not find faction in Player.factionInvitations");
|
||||
} else {
|
||||
joinFaction(faction);
|
||||
}
|
||||
joinFaction(faction);
|
||||
setFaction(null);
|
||||
}
|
||||
|
||||
|
@ -26,6 +26,7 @@ import { CONSTANTS } from "../../Constants";
|
||||
import { Exploit } from "../../Exploits/Exploit";
|
||||
import { Faction } from "../../Faction/Faction";
|
||||
import { Factions } from "../../Faction/Factions";
|
||||
import { InvitationEvent } from "../../Faction/ui/InvitationModal";
|
||||
import { resetGangs } from "../../Gang/AllGangs";
|
||||
import { Cities } from "../../Locations/Cities";
|
||||
import { Locations } from "../../Locations/Locations";
|
||||
@ -104,6 +105,8 @@ export function prestigeAugmentation(this: PlayerObject): void {
|
||||
|
||||
this.factions = [];
|
||||
this.factionInvitations = [];
|
||||
// Clear any pending invitation modals
|
||||
InvitationEvent.emit(null);
|
||||
|
||||
this.queuedAugmentations = [];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user