1
mirror of https://github.com/thepeacockproject/Peacock synced 2025-02-16 16:34:28 +01:00

Fix gamechangers being marked incorrectly as optional

Fixes #212
This commit is contained in:
AnthonyFuller 2023-04-16 00:13:22 +01:00
parent 7e78a76817
commit a465ee7b12

View File

@ -276,6 +276,20 @@ export function mapObjectives(
gameChangerObjectives.push(objective)
}
} else {
if (!gameChangerProps.ObjectivesCategory) {
gameChangerProps.ObjectivesCategory = (() => {
let obj: MissionManifestObjective
for (obj of gameChangerProps.Objectives) {
if (obj.Category === "primary") return "primary"
if (obj.Category === "secondary")
return "secondary"
}
// If we've not hit a primary or secondary objective, we've hit a condition
// I'm not exactly sure if below follows what official does - AF
return "condition"
})()
}
result.set(gamechangerId, {
Type: "gamechanger",
Properties: {