From c4576d7802caf6d3e069554508c7b481169452f1 Mon Sep 17 00:00:00 2001 From: Spythere Date: Thu, 18 Jan 2024 16:36:57 +0100 Subject: [PATCH 1/2] hotfix 4E --- src/utils/vehicleLimitsUtils.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/utils/vehicleLimitsUtils.ts b/src/utils/vehicleLimitsUtils.ts index a8e6264..584c6d5 100644 --- a/src/utils/vehicleLimitsUtils.ts +++ b/src/utils/vehicleLimitsUtils.ts @@ -5,6 +5,10 @@ export type SpeedLimitLocoType = keyof typeof speedLimits; export type MassLimitLocoType = keyof typeof massLimits; export function calculateSpeedLimit(locoType: SpeedLimitLocoType, stockMass: number, isTrainPassenger: boolean) { + console.log(speedLimits[locoType]); + + if (speedLimits[locoType] === undefined) return 0; + const speedTable = speedLimits[locoType][isTrainPassenger ? 'passenger' : 'cargo']; if (!speedTable) return undefined; @@ -16,7 +20,7 @@ export function calculateSpeedLimit(locoType: SpeedLimitLocoType, stockMass: num } export function calculateMassLimit(locoType: MassLimitLocoType, isTrainPassenger: boolean) { - if(massLimits[locoType] === undefined) return 0; - + if (massLimits[locoType] === undefined) return 0; + return massLimits[locoType][isTrainPassenger ? 0 : 1] || 0; } From 2188dbdf9bce16962e2a43b83bb2cbb1104f24b6 Mon Sep 17 00:00:00 2001 From: Spythere Date: Thu, 18 Jan 2024 16:37:15 +0100 Subject: [PATCH 2/2] bump: 1.7.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1c59975..7026bee 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pojazdownik", - "version": "1.7.2", + "version": "1.7.3", "private": true, "scripts": { "dev": "vite",