From cd1a4fa734eb291c00062fa181eb8cb1d9b81e0d Mon Sep 17 00:00:00 2001 From: Spythere Date: Tue, 6 Aug 2024 14:18:26 +0200 Subject: [PATCH] hotfix: checkpoint trains filtering --- src/components/SceneryView/SceneryTimetable.vue | 2 +- src/store/mainStore.ts | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/SceneryView/SceneryTimetable.vue b/src/components/SceneryView/SceneryTimetable.vue index af3fd2b..81908e6 100644 --- a/src/components/SceneryView/SceneryTimetable.vue +++ b/src/components/SceneryView/SceneryTimetable.vue @@ -243,7 +243,7 @@ export default defineComponent({ return this.onlineScenery.scheduledTrains .filter( (ct) => - ct.timetablePathElement.stationName == sceneryName && + // ct.timetablePathElement.stationName == sceneryName && ct.train.region == this.mainStore.region.id && this.chosenCheckpoint && ct.checkpointStop.stopNameRAW.toLowerCase() == this.chosenCheckpoint.toLowerCase() diff --git a/src/store/mainStore.ts b/src/store/mainStore.ts index db7cc11..eeabb5a 100644 --- a/src/store/mainStore.ts +++ b/src/store/mainStore.ts @@ -104,7 +104,7 @@ export const useMainStore = defineStore('mainStore', { arrivalRouteExt: arrival, departureRouteExt: departure, stationName: station.split(' ').slice(0, -1).join(' '), - stationHash: station.split(' ').slice(-1).join(' ') + stationHash: station.split(' ').slice(-1).join(' ').replace('.sc', '') }; }) } @@ -281,7 +281,11 @@ export const useMainStore = defineStore('mainStore', { if (!scheduledTrains) return; scheduledTrains.forEach(({ train, checkpointStop, timetablePathElement, ...v }) => { - if (scenery.name != timetablePathElement.stationName) return; + if ( + scenery.name != timetablePathElement.stationName && + scenery.hash != timetablePathElement.stationHash + ) + return; scenery.scheduledTrains.push({ train, checkpointStop, timetablePathElement, ...v });