File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Source/Orts.Simulation/Simulation Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -1330,7 +1330,7 @@ private void RemoveTrains()
13301330 car . IsPartOfActiveTrain = false ; // to stop sounds
13311331 // remove continers if any
13321332 if ( car . FreightAnimations ? . Animations != null )
1333- car . FreightAnimations ? . RemoveDiscreteFreightAnimations ( car as MSTSWagon ) ;
1333+ car . FreightAnimations ? . RemoveLoads ( ) ;
13341334 }
13351335 }
13361336 }
Original file line number Diff line number Diff line change @@ -865,16 +865,16 @@ public bool CheckForMerge(int i)
865865 }
866866
867867 /// <summary>
868- /// Removes discrete freight animations and containers when AI train is deleted
868+ /// Removes loads (e.g. containers) when AI train is deleted
869869 /// </summary>
870870
871- public void RemoveDiscreteFreightAnimations ( MSTSWagon wagon )
871+ public void RemoveLoads ( )
872872 {
873873 foreach ( var animation in Animations )
874874 {
875875 if ( animation is FreightAnimationDiscrete discreteAnimation && discreteAnimation . Container != null )
876876 {
877- wagon . Simulator . ContainerManager . Containers . Remove ( discreteAnimation . Container ) ;
877+ Wagon . Simulator . ContainerManager . Containers . Remove ( discreteAnimation . Container ) ;
878878 }
879879 }
880880
You can’t perform that action at this time.
0 commit comments