@@ -926,8 +926,6 @@ private void UpdateCouplers(RenderFrame frame, ElapsedTime elapsedTime)
926926 Z = ( Car . FrontCouplerAnimLengthM + ( Car . CarLengthM / 2.0f ) + Car . FrontCouplerSlackM - Car . WagonFrontCouplerCurveExtM )
927927 } ;
928928
929- var tempZ = ( Car . FrontCouplerAnimLengthM + ( Car . CarLengthM / 2.0f ) + Car . FrontCouplerSlackM - Car . WagonFrontCouplerCurveExtM ) ;
930-
931929 if ( Car . CarAhead != null ) // Display animated coupler if there is a car infront of this car
932930 {
933931 var quaternion = PositionCoupler ( Car , FrontCouplerShape , displacement ) ;
@@ -949,6 +947,8 @@ private void UpdateCouplers(RenderFrame frame, ElapsedTime elapsedTime)
949947 if ( ( absXc > 0.005 || absYc > 0.005 || absZc > 0.005 ) )
950948 {
951949 FrontCouplerShape . Location . Location = Car . CarAhead . RearCouplerLocation ; // Set coupler to same location as previous car coupler
950+ FrontCouplerShape . Location . TileX = Car . CarAhead . RearCouplerLocationTileX ;
951+ FrontCouplerShape . Location . TileZ = Car . CarAhead . RearCouplerLocationTileZ ;
952952 }
953953
954954 // Display Animation Shape
@@ -1001,7 +1001,11 @@ private void UpdateCouplers(RenderFrame frame, ElapsedTime elapsedTime)
10011001 // Display Animation Shape
10021002 RearCouplerShape . PrepareFrame ( frame , elapsedTime ) ;
10031003
1004+ // Save coupler location for use on following car front coupler
10041005 Car . RearCouplerLocation = RearCouplerShape . Location . Location ;
1006+ Car . RearCouplerLocationTileX = RearCouplerShape . Location . TileX ;
1007+ Car . RearCouplerLocationTileZ = RearCouplerShape . Location . TileZ ;
1008+
10051009 }
10061010 else if ( RearCouplerOpenShape != null && Car . RearCouplerOpenFitted && Car . RearCouplerOpen ) // Display open coupler if no car is behind car, and an open coupler shape is present
10071011 {
0 commit comments