support zimnego startu lokomotyw

This commit is contained in:
2023-07-13 17:51:09 +02:00
parent 7362d4ffbd
commit cbe983f96c
11 changed files with 108 additions and 81 deletions
+4 -1
View File
@@ -30,6 +30,7 @@ export default defineComponent({
imgSrc: vehicle.imageSrc,
useType: isLoco ? vehicle.power : vehicle.useType,
supportersOnly: vehicle.supportersOnly,
constructionType: vehicle.constructionType,
};
},
@@ -67,13 +68,15 @@ export default defineComponent({
this.store.swapVehicles = false;
stockArray.forEach((type) => {
stockArray.forEach((type, i) => {
let vehicle: Vehicle | null = null;
let vehicleCargo: ICargo | null = null;
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;
if (i == 0 && coldStart == 'c') this.store.isColdStart = true;
} else {
const [carType, cargo] = type.split(':');
vehicle = this.store.carDataList.find((car) => car.type == carType) || null;
+1 -1
View File
@@ -26,7 +26,7 @@ export default defineComponent({
!this.store.isTrainPassenger &&
this.store.stockList.length > 1 &&
!this.store.stockList.every((stock) => stock.isLoco) &&
this.store.stockList.find((stock) => stock.isLoco && stock.type.startsWith('EP'))
this.store.stockList.some((stock) => stock.isLoco && stock.type.startsWith('EP'))
);
},