From c941ec2ba6b86c6f8bade211f6a597aa742edce6 Mon Sep 17 00:00:00 2001 From: Russell Stringer Date: Tue, 11 Jan 2022 12:42:20 -0500 Subject: [PATCH] only check cheevo conditional if player is missing it --- src/Achievements/Achievements.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Achievements/Achievements.ts b/src/Achievements/Achievements.ts index e8febf6ce..dd5d6ece4 100644 --- a/src/Achievements/Achievements.ts +++ b/src/Achievements/Achievements.ts @@ -759,13 +759,13 @@ export const achievements: IMap = { // { ID: "FLIGHT.EXE", Condition: () => Player.getHomeComputer().programs.includes(Programs.Flight.name) }, export function calculateAchievements(): void { - const availableAchievements = Object.values(achievements) - .filter((a) => a.Condition()) - .map((a) => a.ID); const playerAchievements = Player.achievements.map((a) => a.ID); - const newAchievements = availableAchievements.filter((a) => !playerAchievements.includes(a)); - for (const id of newAchievements) { + const missingAchievements = Object.values(achievements) + .filter((a) => !playerAchievements.includes(a.ID) && a.Condition()) + .map((a) => a.ID); + + for (const id of missingAchievements) { Player.giveAchievement(id); }