mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-18 13:43:49 +01:00
Fix stuff I broke in #910
This commit is contained in:
parent
2997384403
commit
e56e3dddf1
@ -33,7 +33,6 @@ export function loadFactions(saveString: string, player: PlayerObject): void {
|
|||||||
if (typeof loadedRep === "number" && loadedRep > 0) faction.playerReputation = loadedRep;
|
if (typeof loadedRep === "number" && loadedRep > 0) faction.playerReputation = loadedRep;
|
||||||
if (typeof loadedFavor === "number" && loadedFavor > 0) faction.favor = loadedFavor;
|
if (typeof loadedFavor === "number" && loadedFavor > 0) faction.favor = loadedFavor;
|
||||||
if (getEnumHelper("FactionDiscovery").isMember(loadedDiscovery)) faction.discovery = loadedDiscovery;
|
if (getEnumHelper("FactionDiscovery").isMember(loadedDiscovery)) faction.discovery = loadedDiscovery;
|
||||||
if (faction.alreadyInvited || faction.isMember) faction.discovery = FactionDiscovery.known;
|
|
||||||
}
|
}
|
||||||
// Load joined factions from player save
|
// Load joined factions from player save
|
||||||
for (const joinedFacName of player.factions) {
|
for (const joinedFacName of player.factions) {
|
||||||
|
@ -179,6 +179,7 @@ export function receiveInvite(this: PlayerObject, factionName: FactionName): voi
|
|||||||
|
|
||||||
export function receiveRumor(this: PlayerObject, factionName: FactionName): void {
|
export function receiveRumor(this: PlayerObject, factionName: FactionName): void {
|
||||||
const faction = Factions[factionName];
|
const faction = Factions[factionName];
|
||||||
|
if (faction.discovery === FactionDiscovery.unknown) faction.discovery = FactionDiscovery.rumored;
|
||||||
if (this.factionRumors.has(factionName) || faction.isMember || faction.isBanned || faction.alreadyInvited) return;
|
if (this.factionRumors.has(factionName) || faction.isMember || faction.isBanned || faction.alreadyInvited) return;
|
||||||
this.factionRumors.add(factionName);
|
this.factionRumors.add(factionName);
|
||||||
}
|
}
|
||||||
@ -624,7 +625,7 @@ export function checkForFactionInvitations(this: PlayerObject): Faction[] {
|
|||||||
const { inviteReqs, rumorReqs } = faction.getInfo();
|
const { inviteReqs, rumorReqs } = faction.getInfo();
|
||||||
if (inviteReqs.every((req) => req.isSatisfied(this))) invitedFactions.push(faction);
|
if (inviteReqs.every((req) => req.isSatisfied(this))) invitedFactions.push(faction);
|
||||||
// Handle rumors
|
// Handle rumors
|
||||||
if (faction.discovery !== FactionDiscovery.unknown) continue;
|
if (this.factionRumors.has(faction.name)) continue;
|
||||||
if (rumorReqs.every((req) => req.isSatisfied(this))) this.receiveRumor(faction.name);
|
if (rumorReqs.every((req) => req.isSatisfied(this))) this.receiveRumor(faction.name);
|
||||||
}
|
}
|
||||||
return invitedFactions;
|
return invitedFactions;
|
||||||
|
Loading…
Reference in New Issue
Block a user