@@ -4102,9 +4102,7 @@ public void DisconnectBrakes()
41024102 {
41034103 if (SpeedMpS < -.1 || SpeedMpS > .1)
41044104 return;
4105- int first = -1;
4106- int last = -1;
4107- FindLeadLocomotives(ref first, ref last);
4105+ FindLeadLocomotives(out int first, out int last);
41084106 for (int i = 0; i < Cars.Count; i++)
41094107 {
41104108 Cars[i].BrakeSystem.FrontBrakeHoseConnected = first < i && i <= last;
@@ -4145,9 +4143,7 @@ public void SetRetainers(bool increase)
41454143 break;
41464144 }
41474145 }
4148- int first = -1;
4149- int last = -1;
4150- FindLeadLocomotives(ref first, ref last);
4146+ FindLeadLocomotives(out int first, out int last);
41514147 int step = 100 / RetainerPercent;
41524148 for (int i = 0; i < Cars.Count; i++)
41534149 {
@@ -4170,7 +4166,7 @@ public void SetRetainers(bool increase)
41704166 // for example a double headed steam locomotive will most often have a tender separating the two locomotives,
41714167 // so the second locomotive will not be identified, nor will a locomotive added at the rear of the train.
41724168
4173- public void FindLeadLocomotives(ref int first, ref int last)
4169+ public void FindLeadLocomotives(out int first, out int last)
41744170 {
41754171 first = last = -1;
41764172 if (LeadLocomotiveIndex >= 0)
@@ -4210,9 +4206,7 @@ public void FindLeadLocomotives(ref int first, ref int last)
42104206
42114207 public TrainCar FindLeadLocomotive()
42124208 {
4213- int first = -1;
4214- int last = -1;
4215- FindLeadLocomotives(ref first, ref last);
4209+ FindLeadLocomotives(out int first, out int last);
42164210 if (first != -1 && first < LeadLocomotiveIndex)
42174211 {
42184212 return Cars[first];
0 commit comments