diff --git a/server/classes/stationSet.ts b/server/classes/stationSet.ts index 31aa75c46..6b8dc7664 100644 --- a/server/classes/stationSet.ts +++ b/server/classes/stationSet.ts @@ -141,11 +141,12 @@ export class Station { }); } matchTags(tags: string[]) { + const components = this.cards.map(t => t.component); for (let t of tags) { if (this.tags.includes(t)) return true; if (this.name === t || pascalCase(this.name) === pascalCase(t)) return true; - if (this.cards.map(t => t.component).includes(pascalCase(t))) return true; + if (components.includes(pascalCase(t))) return true; } return false; } diff --git a/server/tasks/shield.js b/server/tasks/shield.js index b56a1f220..e68ed0ab0 100644 --- a/server/tasks/shield.js +++ b/server/tasks/shield.js @@ -344,6 +344,9 @@ export default [ s => s.simulatorId === simulator.id && s.class === "Shield", ), ); + if (task && (!task?.values.shield || task?.values.shield !== shield.id)) { + task.values.shield = shield.id; + } if (station && task.station === station.name) return reportReplace( `${preamble} Set the frequency of the ${ @@ -369,11 +372,11 @@ export default [ const system = App.systems.find(s => s.id === id); if (requiredValues.frequencyUpper) { return ( - system.frequency > requiredValues.frequency && - system.frequency < requiredValues.frequencyUpper + system?.frequency > requiredValues.frequency && + system?.frequency < requiredValues.frequencyUpper ); } - return system.frequency === requiredValues.frequency; + return system?.frequency === requiredValues.frequency; }, }, ];