From 8e505702c6fc2fd7398ce5db8a4b40ed08813a54 Mon Sep 17 00:00:00 2001 From: peternewell Date: Thu, 15 Feb 2024 14:44:09 +1100 Subject: [PATCH] correct initialisation issue --- .../Simulation/RollingStocks/MSTSSteamLocomotive.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Source/Orts.Simulation/Simulation/RollingStocks/MSTSSteamLocomotive.cs b/Source/Orts.Simulation/Simulation/RollingStocks/MSTSSteamLocomotive.cs index b682ddc9c9..198744c08a 100644 --- a/Source/Orts.Simulation/Simulation/RollingStocks/MSTSSteamLocomotive.cs +++ b/Source/Orts.Simulation/Simulation/RollingStocks/MSTSSteamLocomotive.cs @@ -2606,11 +2606,6 @@ private void UpdateFX(float elapsedClockSeconds) // The duration time is reduced with speed to reduce the steam trail behind the locomotive when running at speed. // Any of the steam effects can be disabled by not defining them in the ENG file, and thus they will not be displayed in the viewer. - - float[] ExhaustnormalisedCrankAngleRad = new float[3]; - float[] ExhaustexhaustCrankAngleRad = new float[3]; - - // Cylinder steam cock effects if (CylinderAdvancedSteamEffects) // For advanced steam effects process each cylinder individually - // - all ENG files will need to be changed. @@ -2626,7 +2621,10 @@ private void UpdateFX(float elapsedClockSeconds) TotalNumberCyindersEng1 = SteamEngines[0].NumberCylinders; } - // Engine #1 + float[] ExhaustnormalisedCrankAngleRad = new float[TotalNumberCyindersEng1]; + float[] ExhaustexhaustCrankAngleRad = new float[TotalNumberCyindersEng1]; + + // Engine #1 for (int i = 0; i < TotalNumberCyindersEng1; i++) { var crankAngleDiffRad = WheelCrankAngleDiffRad[i];