hotfix: wykrywanie zimnego startu

This commit is contained in:
2023-02-16 15:05:35 +01:00
parent dd973c5593
commit 7ea7ad5da2
+4 -3
View File
@@ -87,9 +87,10 @@ export default defineComponent({
let vehicle: Vehicle | null = null; let vehicle: Vehicle | null = null;
let vehicleCargo: ICargo | null = null; let vehicleCargo: ICargo | null = null;
if (/^(EU|EP|ET|SM|EN|2EN|SN)/.test(type)) if (/^(EU|EP|ET|SM|EN|2EN|SN)/.test(type)) {
vehicle = this.store.locoDataList.find((loco) => loco.type == type) || null; const [locoType, coldStart] = type.split(',');
else { vehicle = this.store.locoDataList.find((loco) => loco.type == locoType) || null;
} else {
const [carType, cargo] = type.split(':'); const [carType, cargo] = type.split(':');
vehicle = this.store.carDataList.find((car) => car.type == carType) || null; vehicle = this.store.carDataList.find((car) => car.type == carType) || null;