diff --git a/src/DevMenu/ui/General.tsx b/src/DevMenu/ui/General.tsx index c00ff189d..08e41cf76 100644 --- a/src/DevMenu/ui/General.tsx +++ b/src/DevMenu/ui/General.tsx @@ -24,6 +24,7 @@ import { GangConstants } from "../../Gang/data/Constants"; import { checkForMessagesToSend } from "../../Message/MessageHelpers"; import { getEnumHelper } from "../../utils/EnumHelper"; import { formatRam } from "../../ui/formatNumber"; +import { resetGangs } from "../../Gang/AllGangs"; export function General({ parentRerender }: { parentRerender: () => void }): React.ReactElement { const rerender = useRerender(400); @@ -87,6 +88,7 @@ export function General({ parentRerender }: { parentRerender: () => void }): Rea }; const stopGang = () => { Player.gang = null; + resetGangs(); parentRerender(); }; const setGangFactionDropdown = (event: SelectChangeEvent) => { diff --git a/src/Gang/AllGangs.ts b/src/Gang/AllGangs.ts index 3e480f2cc..1569ffb59 100644 --- a/src/Gang/AllGangs.ts +++ b/src/Gang/AllGangs.ts @@ -6,39 +6,8 @@ interface GangTerritory { territory: number; } -export let AllGangs: Record = { - [FactionName.SlumSnakes]: { - power: 1, - territory: 1 / 7, - }, - [FactionName.Tetrads]: { - power: 1, - territory: 1 / 7, - }, - [FactionName.TheSyndicate]: { - power: 1, - territory: 1 / 7, - }, - [FactionName.TheDarkArmy]: { - power: 1, - territory: 1 / 7, - }, - [FactionName.SpeakersForTheDead]: { - power: 1, - territory: 1 / 7, - }, - [FactionName.NiteSec]: { - power: 1, - territory: 1 / 7, - }, - [FactionName.TheBlackHand]: { - power: 1, - territory: 1 / 7, - }, -}; - -export function resetGangs(): void { - AllGangs = { +function getDefaultAllGangs() { + return { [FactionName.SlumSnakes]: { power: 1, territory: 1 / 7, @@ -70,6 +39,12 @@ export function resetGangs(): void { }; } +export let AllGangs: Record = getDefaultAllGangs(); + +export function resetGangs(): void { + AllGangs = getDefaultAllGangs(); +} + export function loadAllGangs(saveString: string): void { AllGangs = JSON.parse(saveString, Reviver); }