Skip to content

Commit a215a71

Browse files
committed
Cleanup of AcceptMUSignals variable
1 parent 7196655 commit a215a71

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1837,7 +1837,7 @@ public override void Update(float elapsedClockSeconds)
18371837
{
18381838
case Train.TRAINTYPE.AI:
18391839
case Train.TRAINTYPE.AI_PLAYERHOSTING:
1840-
if (AcceptMUSignals)
1840+
if (RemoteControlGroup != -1)
18411841
{
18421842
if (!LocomotivePowerSupply.MainPowerSupplyOn)
18431843
{
@@ -5038,7 +5038,7 @@ public virtual float GetDataOf(CabViewControl cvc)
50385038
foreach (var car in Train.Cars)
50395039
{
50405040
var dieselLoco = car as MSTSDieselLocomotive;
5041-
if (dieselLoco != null && dieselLoco.AcceptMUSignals)
5041+
if (dieselLoco != null && dieselLoco.RemoteControlGroup != -1)
50425042
{
50435043
if (car == Simulator.PlayerLocomotive && dieselLoco.DieselEngines.Count > 1)
50445044
{

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ protected virtual void AssignScriptFunctions()
278278
{
279279
DieselEngineState state = DieselEngineState.Unavailable;
280280

281-
foreach (MSTSDieselLocomotive locomotive in Train.Cars.OfType<MSTSDieselLocomotive>().Where((MSTSLocomotive locomotive) => { return locomotive.AcceptMUSignals; }))
281+
foreach (MSTSDieselLocomotive locomotive in Train.Cars.OfType<MSTSDieselLocomotive>().Where((MSTSLocomotive locomotive) => { return locomotive.RemoteControlGroup != -1; }))
282282
{
283283
if (locomotive == Simulator.PlayerLocomotive)
284284
{
@@ -330,7 +330,7 @@ protected virtual void AssignScriptFunctions()
330330
{
331331
foreach (MSTSLocomotive locomotive in Locomotive.Train.Cars.OfType<MSTSLocomotive>())
332332
{
333-
if (locomotive != Locomotive && locomotive != Locomotive.Train.LeadLocomotive && locomotive.AcceptMUSignals)
333+
if (locomotive != Locomotive && locomotive != Locomotive.Train.LeadLocomotive && locomotive.RemoteControlGroup != -1)
334334
{
335335
locomotive.LocomotivePowerSupply.HandleEventFromLeadLocomotive(evt);
336336
}
@@ -343,7 +343,7 @@ protected virtual void AssignScriptFunctions()
343343
{
344344
foreach (MSTSLocomotive locomotive in Locomotive.Train.Cars.OfType<MSTSLocomotive>())
345345
{
346-
if (locomotive != Locomotive && locomotive != Locomotive.Train.LeadLocomotive && locomotive.AcceptMUSignals)
346+
if (locomotive != Locomotive && locomotive != Locomotive.Train.LeadLocomotive && locomotive.RemoteControlGroup != -1)
347347
{
348348
locomotive.LocomotivePowerSupply.HandleEventFromLeadLocomotive(evt, id);
349349
}
@@ -356,7 +356,7 @@ protected virtual void AssignScriptFunctions()
356356
{
357357
foreach (TrainCar car in Locomotive.Train.Cars)
358358
{
359-
if (car != Locomotive && car != Locomotive.Train.LeadLocomotive && car.AcceptMUSignals)
359+
if (car != Locomotive && car != Locomotive.Train.LeadLocomotive && car.RemoteControlGroup != -1)
360360
{
361361
car.PowerSupply?.HandleEventFromLeadLocomotive(evt);
362362
}
@@ -369,7 +369,7 @@ protected virtual void AssignScriptFunctions()
369369
{
370370
foreach (TrainCar car in Locomotive.Train.Cars)
371371
{
372-
if (car != Locomotive && car != Locomotive.Train.LeadLocomotive && car.AcceptMUSignals)
372+
if (car != Locomotive && car != Locomotive.Train.LeadLocomotive && car.RemoteControlGroup != -1)
373373
{
374374
car.PowerSupply?.HandleEventFromLeadLocomotive(evt, id);
375375
}
@@ -380,7 +380,7 @@ protected virtual void AssignScriptFunctions()
380380
{
381381
bool helperFound = false; //this avoids that locomotive engines toggle in opposite directions
382382

383-
foreach (MSTSDieselLocomotive locomotive in Train.Cars.OfType<MSTSDieselLocomotive>().Where((MSTSLocomotive locomotive) => { return locomotive.AcceptMUSignals; }))
383+
foreach (MSTSDieselLocomotive locomotive in Train.Cars.OfType<MSTSDieselLocomotive>().Where((MSTSLocomotive locomotive) => { return locomotive.RemoteControlGroup != -1; }))
384384
{
385385
if (locomotive == Simulator.PlayerLocomotive)
386386
{

Source/Orts.Simulation/Simulation/RollingStocks/TrainCar.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ public static Interpolator WorldSummerLatitudetoTemperatureC()
432432
return new Interpolator(WorldLatitudeDeg, WorldTemperatureSummer);
433433
}
434434

435-
public bool AcceptMUSignals = true; //indicates if the car accepts multiple unit signals
435+
public bool AcceptMUSignals = true; //indicates if the car accepts multiple unit signals; no more used
436436
/// <summary>
437437
/// Indicates which remote control group the car is in.
438438
/// -1: unconnected, 0: sync/front group, 1: async/rear group
@@ -532,7 +532,7 @@ public float DynamicBrakePercent
532532
}
533533
set
534534
{
535-
if (AcceptMUSignals && Train != null)
535+
if (RemoteControlGroup != -1 && Train != null)
536536
Train.MUDynamicBrakePercent = value;
537537
else
538538
LocalDynamicBrakePercent = value;

Source/RunActivity/Viewer3D/RollingStock/MSTSLocomotiveViewer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2238,7 +2238,7 @@ public void HandleUserInput()
22382238
foreach (var car in Locomotive.Train.Cars)
22392239
{
22402240
dieselLoco = car as MSTSDieselLocomotive;
2241-
if (dieselLoco != null && dieselLoco.AcceptMUSignals)
2241+
if (dieselLoco != null && dieselLoco.RemoteControlGroup != -1)
22422242
{
22432243
if (car == Viewer.Simulator.PlayerLocomotive && dieselLoco.DieselEngines.Count > 1)
22442244
{

0 commit comments

Comments
 (0)