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
@@ -723,9 +723,12 @@ public void RotateTrain(Matrix animationXNAMatrix)
723723 var iRelativeCarPositions = 0 ;
724724 foreach ( TrainCar traincar in TrainsOnMovingTable [ 0 ] . Train . Cars )
725725 {
726- traincar . WorldPosition . XNAMatrix = Matrix . Multiply ( RelativeCarPositions [ iRelativeCarPositions ] , AnimationXNAMatrix ) ;
727- traincar . UpdateFreightAnimationDiscretePositions ( ) ;
728- iRelativeCarPositions ++ ;
726+ if ( RelativeCarPositions != null )
727+ {
728+ traincar . WorldPosition . XNAMatrix = Matrix . Multiply ( RelativeCarPositions [ iRelativeCarPositions ] , AnimationXNAMatrix ) ;
729+ traincar . UpdateFreightAnimationDiscretePositions ( ) ;
730+ iRelativeCarPositions ++ ;
731+ }
729732 }
730733 }
731734 }
You can’t perform that action at this time.
0 commit comments