File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Source/Orts.Simulation/Simulation Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -179,9 +179,9 @@ public virtual void Restore(BinaryReader inf, Simulator simulator)
179179 }
180180
181181 int trainsInQ = inf . ReadInt32 ( ) ;
182- for ( int iQ = 0 ; iQ < trainsInQ - 1 ; iQ ++ )
182+ for ( int iQ = 0 ; iQ < trainsInQ ; iQ ++ )
183183 {
184- Q . Enqueue ( iQ ) ;
184+ Q . Enqueue ( inf . ReadInt32 ( ) ) ;
185185 }
186186 }
187187
@@ -709,9 +709,12 @@ public void RotateTrain(Matrix animationXNAMatrix)
709709 var iRelativeCarPositions = 0 ;
710710 foreach ( TrainCar traincar in TrainsOnMovingTable [ 0 ] . Train . Cars )
711711 {
712- traincar . WorldPosition . XNAMatrix = Matrix . Multiply ( RelativeCarPositions [ iRelativeCarPositions ] , AnimationXNAMatrix ) ;
713- traincar . UpdateFreightAnimationDiscretePositions ( ) ;
714- iRelativeCarPositions ++ ;
712+ if ( RelativeCarPositions != null )
713+ {
714+ traincar . WorldPosition . XNAMatrix = Matrix . Multiply ( RelativeCarPositions [ iRelativeCarPositions ] , AnimationXNAMatrix ) ;
715+ traincar . UpdateFreightAnimationDiscretePositions ( ) ;
716+ iRelativeCarPositions ++ ;
717+ }
715718 }
716719 }
717720 }
You can’t perform that action at this time.
0 commit comments