From 7ea7ad5da2f0edeb6810960775b807a70ab63281 Mon Sep 17 00:00:00 2001 From: Spythere Date: Thu, 16 Feb 2023 15:05:35 +0100 Subject: [PATCH] hotfix: wykrywanie zimnego startu --- src/mixins/stockMixin.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mixins/stockMixin.ts b/src/mixins/stockMixin.ts index 0e3de8c..6f1a633 100644 --- a/src/mixins/stockMixin.ts +++ b/src/mixins/stockMixin.ts @@ -87,9 +87,10 @@ export default defineComponent({ let vehicle: Vehicle | null = null; let vehicleCargo: ICargo | null = null; - if (/^(EU|EP|ET|SM|EN|2EN|SN)/.test(type)) - vehicle = this.store.locoDataList.find((loco) => loco.type == type) || null; - else { + if (/^(EU|EP|ET|SM|EN|2EN|SN)/.test(type)) { + const [locoType, coldStart] = type.split(','); + vehicle = this.store.locoDataList.find((loco) => loco.type == locoType) || null; + } else { const [carType, cargo] = type.split(':'); vehicle = this.store.carDataList.find((car) => car.type == carType) || null;