Skip to content

Commit

Permalink
fix(Tasks): Fixes an issue with the shield frequency task. Closes #2954
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderson1993 committed May 25, 2020
1 parent 2d1f444 commit 23625a7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion server/classes/stationSet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
9 changes: 6 additions & 3 deletions server/tasks/shield.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ${
Expand All @@ -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;
},
},
];

0 comments on commit 23625a7

Please sign in to comment.