Skip to content

Commit 505e169

Browse files
committed
Automatic merge of T1.5.1-1004-g6fd841761e and 21 pull requests
- Pull request #799 at dfc715e: Consolidated wind simulation - Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters - Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder - Pull request #882 at 8f695a4: Blueprint/train car operations UI window - Pull request #885 at 2728d6d: feat: Add notifications to Menu - Pull request #891 at 9a1d6b2: Auto save - Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH - Pull request #896 at 5866028: First implementation of https://blueprints.launchpad.net/or/+spec/specific-sounds-for-ai-trains - Pull request #900 at c27f32d: DMI updates - Pull request #903 at 3e390b8: Downloading route content (Github, zip) - Pull request #912 at 359cfee: New Triple Valve Features Vol. 2 - Pull request #922 at 0d3e70b: Autopilot for timetable mode - Pull request #946 at 91a03af: Advanced track sounds - Pull request #949 at f2fff29: Oil Burning Locomotive - Pull request #952 at 8347095: Investigation - Pulsing graphics - Pull request #953 at a519452: Fix Lights Crash on Corrupt Shapes - Pull request #954 at 84c2f4b: Add Support for Multiple Track Profiles - Pull request #956 at 406cba6: Map settings saved - Pull request #959 at 2452cb0: Fix TrackViewer crash on big zoom value - Pull request #960 at c8e2a28: Fix draw state name in scripts - Pull request #962 at 46d0472: Fix pantographs on unpowered cars
23 parents 6afcf32 + 6fd8417 + dfc715e + d00beb9 + f92de76 + 8f695a4 + 2728d6d + 9a1d6b2 + 1f5ba4c + 5866028 + c27f32d + 3e390b8 + 359cfee + 0d3e70b + 91a03af + f2fff29 + 8347095 + a519452 + 84c2f4b + 406cba6 + 2452cb0 + c8e2a28 + 46d0472 commit 505e169

File tree

4 files changed

+36
-3
lines changed

4 files changed

+36
-3
lines changed

Source/Orts.Formats.Msts/ActivityFile.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,8 @@ public class Tr_Activity_Header {
400400
public int FuelWater = 100; // percent
401401
public int FuelCoal = 100; // percent
402402
public int FuelDiesel = 100; // percent
403+
public int FuelWood = 100; // percent
404+
public int FuelSand = 100; // percent
403405
public string LoadStationsPopulationFile;
404406

405407
public Tr_Activity_Header(STFReader stf) {
@@ -423,7 +425,9 @@ public Tr_Activity_Header(STFReader stf) {
423425
new STFReader.TokenProcessor("workers", ()=>{ Workers = stf.ReadIntBlock(Workers); }),
424426
new STFReader.TokenProcessor("fuelwater", ()=>{ FuelWater = stf.ReadIntBlock(FuelWater); }),
425427
new STFReader.TokenProcessor("fuelcoal", ()=>{ FuelCoal = stf.ReadIntBlock(FuelCoal); }),
428+
new STFReader.TokenProcessor("fuelwood", ()=>{ FuelWood = stf.ReadIntBlock(FuelWood); }),
426429
new STFReader.TokenProcessor("fueldiesel", ()=>{ FuelDiesel = stf.ReadIntBlock(FuelDiesel); }),
430+
new STFReader.TokenProcessor("fuelsand", ()=>{ FuelSand = stf.ReadIntBlock(FuelSand); }),
427431
new STFReader.TokenProcessor("ortsloadstationspopulation", ()=>{ LoadStationsPopulationFile = stf.ReadStringBlock(null); }),
428432
});
429433
}

Source/Orts.Simulation/Simulation/AIs/AI.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -927,8 +927,22 @@ public AITrain CreateAITrainDetail(Service_Definition sd, Traffic_Service_Defini
927927

928928
if (Simulator.Activity != null && car is MSTSSteamLocomotive mstsSteamLocomotive)
929929
{
930+
930931
mstsSteamLocomotive.CombinedTenderWaterVolumeUKG = ORTS.Common.Kg.ToLb(mstsSteamLocomotive.MaxLocoTenderWaterMassKG) / 10.0f * Simulator.Activity.Tr_Activity.Tr_Activity_Header.FuelWater / 100.0f;
931-
mstsSteamLocomotive.TenderFuelMassKG = mstsSteamLocomotive.MaxTenderFuelMassKG * Simulator.Activity.Tr_Activity.Tr_Activity_Header.FuelCoal / 100.0f;
932+
933+
// Adjust fuel stocks depending upon fuel used - in Activity mode
934+
if (mstsSteamLocomotive.SteamLocomotiveFuelType == MSTSLocomotive.SteamLocomotiveFuelTypes.Wood)
935+
{
936+
mstsSteamLocomotive.TenderFuelMassKG = mstsSteamLocomotive.MaxTenderFuelMassKG * Simulator.Activity.Tr_Activity.Tr_Activity_Header.FuelWood / 100.0f;
937+
}
938+
else if (mstsSteamLocomotive.SteamLocomotiveFuelType == MSTSLocomotive.SteamLocomotiveFuelTypes.Oil)
939+
{
940+
mstsSteamLocomotive.TenderFuelMassKG = mstsSteamLocomotive.MaxTenderFuelMassKG * Simulator.Activity.Tr_Activity.Tr_Activity_Header.FuelDiesel / 100.0f;
941+
}
942+
else // defaults to coal fired
943+
{
944+
mstsSteamLocomotive.TenderFuelMassKG = mstsSteamLocomotive.MaxTenderFuelMassKG * Simulator.Activity.Tr_Activity.Tr_Activity_Header.FuelCoal / 100.0f;
945+
}
932946
}
933947

934948
if (train.InitialSpeed != 0 && car is MSTSLocomotive loco)

Source/Orts.Simulation/Simulation/RollingStocks/MSTSLocomotive.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ public enum SoundState
186186
bool WaterScoopSoundOn = false;
187187
public float MaxTotalCombinedWaterVolumeUKG;
188188
public MSTSNotchController WaterController = new MSTSNotchController(0, 1, 0.01f);
189-
public float CombinedTenderWaterVolumeUKG // Decreased by running injectors and increased by refilling
189+
public float CombinedTenderWaterVolumeUKG // Decreased by running injectors or pumps and increased by refilling
190190
{
191191
get { return WaterController.CurrentValue * MaxTotalCombinedWaterVolumeUKG; }
192192
set { WaterController.CurrentValue = value / MaxTotalCombinedWaterVolumeUKG; }

Source/Orts.Simulation/Simulation/Simulator.cs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1321,11 +1321,26 @@ private Train InitializePlayerTrain()
13211321
if (Activity != null && mstsDieselLocomotive != null)
13221322
mstsDieselLocomotive.DieselLevelL = mstsDieselLocomotive.MaxDieselLevelL * Activity.Tr_Activity.Tr_Activity_Header.FuelDiesel / 100.0f;
13231323

1324+
1325+
13241326
var mstsSteamLocomotive = car as MSTSSteamLocomotive;
13251327
if (Activity != null && mstsSteamLocomotive != null)
13261328
{
13271329
mstsSteamLocomotive.CombinedTenderWaterVolumeUKG = (Kg.ToLb(mstsSteamLocomotive.MaxLocoTenderWaterMassKG) / 10.0f) * Activity.Tr_Activity.Tr_Activity_Header.FuelWater / 100.0f;
1328-
mstsSteamLocomotive.TenderFuelMassKG = mstsSteamLocomotive.MaxTenderFuelMassKG * Activity.Tr_Activity.Tr_Activity_Header.FuelCoal / 100.0f;
1330+
1331+
// Adjust fuel stocks depending upon fuel used - in Explore mode
1332+
if (mstsSteamLocomotive.SteamLocomotiveFuelType == MSTSLocomotive.SteamLocomotiveFuelTypes.Wood)
1333+
{
1334+
mstsSteamLocomotive.TenderFuelMassKG = mstsSteamLocomotive.MaxTenderFuelMassKG * Activity.Tr_Activity.Tr_Activity_Header.FuelWood / 100.0f;
1335+
}
1336+
else if (mstsSteamLocomotive.SteamLocomotiveFuelType == MSTSLocomotive.SteamLocomotiveFuelTypes.Oil)
1337+
{
1338+
mstsSteamLocomotive.TenderFuelMassKG = mstsSteamLocomotive.MaxTenderFuelMassKG * Activity.Tr_Activity.Tr_Activity_Header.FuelDiesel / 100.0f;
1339+
}
1340+
else // defaults to coal fired
1341+
{
1342+
mstsSteamLocomotive.TenderFuelMassKG = mstsSteamLocomotive.MaxTenderFuelMassKG * Activity.Tr_Activity.Tr_Activity_Header.FuelCoal / 100.0f;
1343+
}
13291344
}
13301345
}
13311346
catch (Exception error)

0 commit comments

Comments
 (0)