Skip to content

Commit 5823f2e

Browse files
committed
Signal events for AI trains
1 parent 3186040 commit 5823f2e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Source/Orts.Simulation/Common/Scripting/PowerSupply/LocomotivePowerSupply.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ protected void SetCustomizedCabviewControlName(int index, string name)
312312
/// </summary>
313313
protected void SignalEventToOtherLocomotives(PowerSupplyEvent evt)
314314
{
315-
if (Locomotive == Train.LeadLocomotive)
315+
if (Locomotive == Train.LeadLocomotive || (Train.LeadLocomotive == null && IndexOfLocomotive() == 0))
316316
{
317317
foreach (TrainCar car in Train.Cars)
318318
{
@@ -329,7 +329,7 @@ protected void SignalEventToOtherLocomotives(PowerSupplyEvent evt)
329329
/// </summary>
330330
protected void SignalEventToOtherLocomotivesWithId(PowerSupplyEvent evt, int id)
331331
{
332-
if (Locomotive == Train.LeadLocomotive)
332+
if (Locomotive == Train.LeadLocomotive || (Train.LeadLocomotive == null && IndexOfLocomotive() == 0))
333333
{
334334
foreach (TrainCar car in Train.Cars)
335335
{
@@ -346,7 +346,7 @@ protected void SignalEventToOtherLocomotivesWithId(PowerSupplyEvent evt, int id)
346346
/// </summary>
347347
protected void SignalEventToOtherTrainVehicles(PowerSupplyEvent evt)
348348
{
349-
if (Locomotive == Train.LeadLocomotive)
349+
if (Locomotive == Train.LeadLocomotive || (Train.LeadLocomotive == null && IndexOfLocomotive() == 0))
350350
{
351351
foreach (TrainCar car in Train.Cars)
352352
{

0 commit comments

Comments
 (0)