Skip to content

Commit

Permalink
Correct issue with tender water mass
Browse files Browse the repository at this point in the history
  • Loading branch information
peternewell committed Oct 25, 2021
1 parent 1dae11d commit 78c046c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Source/Orts.Simulation/Simulation/RollingStocks/MSTSWagon.cs
Expand Up @@ -1836,14 +1836,15 @@ public override void Update(float elapsedClockSeconds)
if (TendersSteamLocomotive != null)
{
if (TendersSteamLocomotive.IsTenderRequired == 1)
{
TendersSteamLocomotive.MaxTenderCoalMassKG = TenderWagonMaxCoalMassKG;

{
// Combined total water found by taking the current combined water (which may have extra water added via the auxiliary tender), and subtracting the
// amount of water defined in the ENG file, and adding the water defiend in the WAG file.
float TempMaxCombinedWater = TendersSteamLocomotive.MaxTotalCombinedWaterVolumeUKG;
TendersSteamLocomotive.MaxTotalCombinedWaterVolumeUKG = (TempMaxCombinedWater - (Kg.ToLb(TendersSteamLocomotive.MaxLocoTenderWaterMassKG) / WaterLBpUKG)) + (Kg.ToLb(TenderWagonMaxWaterMassKG) / WaterLBpUKG);

TendersSteamLocomotive.MaxTenderCoalMassKG = TenderWagonMaxCoalMassKG;
TendersSteamLocomotive.MaxLocoTenderWaterMassKG = TenderWagonMaxWaterMassKG;

if (Simulator.Settings.VerboseConfigurationMessages)
{
Trace.TraceInformation("Fuel and Water Masses adjusted to Tender Values Specified in WAG File - Coal mass {0} kg, Water Mass {1}", FormatStrings.FormatMass(TendersSteamLocomotive.MaxTenderCoalMassKG, IsMetric), FormatStrings.FormatFuelVolume(L.FromGUK(TendersSteamLocomotive.MaxTotalCombinedWaterVolumeUKG), IsMetric, IsUK));
Expand Down

0 comments on commit 78c046c

Please sign in to comment.