Compare commits

...

3 Commits

Author SHA1 Message Date
Spythere bd9af9a630 Merge pull request #18 from Spythere/development
Wersja 1.7.3
2024-01-18 17:57:01 +01:00
Spythere 2188dbdf9b bump: 1.7.3 2024-01-18 16:37:15 +01:00
Spythere c4576d7802 hotfix 4E 2024-01-18 16:36:57 +01:00
2 changed files with 7 additions and 3 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "pojazdownik", "name": "pojazdownik",
"version": "1.7.2", "version": "1.7.3",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
+5 -1
View File
@@ -5,6 +5,10 @@ export type SpeedLimitLocoType = keyof typeof speedLimits;
export type MassLimitLocoType = keyof typeof massLimits; export type MassLimitLocoType = keyof typeof massLimits;
export function calculateSpeedLimit(locoType: SpeedLimitLocoType, stockMass: number, isTrainPassenger: boolean) { 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']; const speedTable = speedLimits[locoType][isTrainPassenger ? 'passenger' : 'cargo'];
if (!speedTable) return undefined; if (!speedTable) return undefined;
@@ -16,7 +20,7 @@ export function calculateSpeedLimit(locoType: SpeedLimitLocoType, stockMass: num
} }
export function calculateMassLimit(locoType: MassLimitLocoType, isTrainPassenger: boolean) { 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; return massLimits[locoType][isTrainPassenger ? 0 : 1] || 0;
} }