Skip to content

Commit 0641acb

Browse files
authored
Merge pull request #455 from Sharpe49/power-supply-fix-passenger-car-save-restore
Fix mismatch between saved and restored values in PassengerCarPowerSupply and added missing values https://bugs.launchpad.net/or/+bug/1938607
2 parents 0748070 + 1b87b91 commit 0641acb

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/PowerSupplies/PassengerCarPowerSupply.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,11 @@ public virtual void Save(BinaryWriter outf)
175175
outf.Write(ElectricTrainSupplyState.ToString());
176176
outf.Write(LowVoltagePowerSupplyState.ToString());
177177
outf.Write(BatteryState.ToString());
178+
outf.Write(VentilationState.ToString());
179+
outf.Write(HeatingState.ToString());
180+
outf.Write(AirConditioningState.ToString());
181+
182+
outf.Write(HeatFlowRateW);
178183
}
179184

180185
public virtual void Restore(BinaryReader inf)
@@ -184,7 +189,13 @@ public virtual void Restore(BinaryReader inf)
184189
FrontElectricTrainSupplyCableConnected = inf.ReadBoolean();
185190

186191
ElectricTrainSupplyState = (PowerSupplyState)Enum.Parse(typeof(PowerSupplyState), inf.ReadString());
192+
LowVoltagePowerSupplyState = (PowerSupplyState)Enum.Parse(typeof(PowerSupplyState), inf.ReadString());
187193
BatteryState = (PowerSupplyState)Enum.Parse(typeof(PowerSupplyState), inf.ReadString());
194+
VentilationState = (PowerSupplyState)Enum.Parse(typeof(PowerSupplyState), inf.ReadString());
195+
HeatingState = (PowerSupplyState)Enum.Parse(typeof(PowerSupplyState), inf.ReadString());
196+
AirConditioningState = (PowerSupplyState)Enum.Parse(typeof(PowerSupplyState), inf.ReadString());
197+
198+
HeatFlowRateW = inf.ReadSingle();
188199

189200
IsFirstUpdate = false;
190201
}

0 commit comments

Comments
 (0)