You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Automatic merge of T1.6-rc2-41-gacd714487 and 10 pull requests
- Pull request #1104 at 03ccdc6: Handle simple adhesion within the axle module
- Pull request #1086 at e10390b: Add Settings Exporter tool (copy settings to INI, etc)
- Pull request #1091 at 2391bc0: Automatic speed control
- Pull request #1110 at 387388e: Fix Activity Runner persists after loading exception
- Pull request #1114 at 9a4a873: Fix color of DB in DrivingInfo when in setup with DPU fenced. (r1.6)
- Pull request #1115 at 270f22f: Do not activate ETS switch if no suitable cars are attached
- Pull request #1116 at 721d118: Fix Potential Hang in AnimatedPart.SetFrameWrap
- Pull request #1118 at f1e0f35: Fix DPMode when last remote is moved to front. (r1.6)
- Pull request #1082 at 5845a1a: Allow variable water level in glass gauge
- Pull request #1081 at 689494b: Brake cuts power unification
Copy file name to clipboardExpand all lines: Source/Orts.Simulation/Simulation/Physics/Train.cs
+15Lines changed: 15 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1628,6 +1628,7 @@ public void DPMoveToFront()
1628
1628
if (LeadLocomotive == null || (LeadLocomotive as MSTSLocomotive).DPDynamicBrakeController == null)
1629
1629
return;
1630
1630
int idToMove = -1;
1631
+
bool stillHasRemotes = false;
1631
1632
for (var i = 0; i < Cars.Count; i++)
1632
1633
{
1633
1634
if (!(Cars[i] is MSTSLocomotive))
@@ -1641,7 +1642,12 @@ public void DPMoveToFront()
1641
1642
Cars[i].RemoteControlGroup = 0;
1642
1643
else if (idToMove > -1 && Cars[i].RemoteControlGroup == 0)
1643
1644
Cars[i].RemoteControlGroup = 1;
1645
+
1646
+
if (Cars[i].RemoteControlGroup == 1)
1647
+
stillHasRemotes = true;
1644
1648
}
1649
+
if (!stillHasRemotes)
1650
+
DPMode = 0;
1645
1651
}
1646
1652
1647
1653
/// <summary>
@@ -1656,6 +1662,7 @@ public void DPMoveToBack()
1656
1662
var dpDynamicBrakeCurrentNotch = MathHelper.Clamp((LeadLocomotive as MSTSLocomotive).DPDynamicBrakeController.GetNotch(dpDynamicBrakePercent/100), 0, 8);
1657
1663
var dpThrottleCurrentNotch = (LeadLocomotive as MSTSLocomotive).ThrottleController.CurrentNotch;
1658
1664
int idToMove = -1;
1665
+
bool alreadyHasRemotes = false;
1659
1666
int idLead = LeadLocomotive != null ? (Cars[LeadLocomotiveIndex] as MSTSLocomotive).DPUnitID : -1;
1660
1667
for (var i = Cars.Count - 1; i >= 0; i--)
1661
1668
{
@@ -1667,6 +1674,7 @@ public void DPMoveToBack()
1667
1674
dpThrottlePercent = DPThrottlePercent;
1668
1675
dpDynamicBrakeCurrentNotch = (LeadLocomotive as MSTSLocomotive).DPDynamicBrakeController.CurrentNotch;
1669
1676
dpThrottleCurrentNotch = (LeadLocomotive as MSTSLocomotive).DPThrottleController.CurrentNotch;
1677
+
alreadyHasRemotes = true;
1670
1678
continue;
1671
1679
}
1672
1680
if (idToMove == -1 && Cars[i].RemoteControlGroup == 0)
@@ -1686,6 +1694,13 @@ public void DPMoveToBack()
1686
1694
else if (idToMove > -1 && Cars[i].RemoteControlGroup == 1)
1687
1695
Cars[i].RemoteControlGroup = 0;
1688
1696
}
1697
+
if (!alreadyHasRemotes)
1698
+
{
1699
+
if (LeadLocomotive.ThrottlePercent > 0)
1700
+
DPMode = 1;
1701
+
else if (LeadLocomotive.DynamicBrakePercent >= 0) // off is -1
0 commit comments