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
@@ -723,9 +723,12 @@ public void RotateTrain(Matrix animationXNAMatrix)
723
723
var iRelativeCarPositions = 0 ;
724
724
foreach ( TrainCar traincar in TrainsOnMovingTable [ 0 ] . Train . Cars )
725
725
{
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
+ }
729
732
}
730
733
}
731
734
}
You can’t perform that action at this time.
0 commit comments