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)
179
179
}
180
180
181
181
int trainsInQ = inf . ReadInt32 ( ) ;
182
- for ( int iQ = 0 ; iQ < trainsInQ - 1 ; iQ ++ )
182
+ for ( int iQ = 0 ; iQ < trainsInQ ; iQ ++ )
183
183
{
184
- Q . Enqueue ( iQ ) ;
184
+ Q . Enqueue ( inf . ReadInt32 ( ) ) ;
185
185
}
186
186
}
187
187
@@ -709,9 +709,12 @@ public void RotateTrain(Matrix animationXNAMatrix)
709
709
var iRelativeCarPositions = 0 ;
710
710
foreach ( TrainCar traincar in TrainsOnMovingTable [ 0 ] . Train . Cars )
711
711
{
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
+ }
715
718
}
716
719
}
717
720
}
You can’t perform that action at this time.
0 commit comments