File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Source/Orts.Simulation/Simulation Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -42,8 +42,11 @@ public class Transfertable : MovingTable
4242 {
4343 public float Span ; // horizontal or vertical
4444 public List < float > Offsets = new List < float > ( ) ;
45- public float CenterOffsetComponent = 0 ;
4645 private bool VerticalTransfer = false ;
46+ public float CenterOffsetComponent
47+ {
48+ get => VerticalTransfer ? CenterOffset . Y : CenterOffset . X ;
49+ }
4750 // Dynamic data
4851 public bool Forward ; // forward motion on
4952 public bool Reverse ; // reverse motion on
@@ -154,12 +157,12 @@ protected void InitializeOffsetsAndTrackNodes()
154157 }
155158 if ( VerticalTransfer )
156159 {
157- OffsetPos = CenterOffsetComponent = CenterOffset . Y ;
160+ OffsetPos = CenterOffset . Y ;
158161 Span = ( float ) ( trackShape . SectionIdxs [ trackShape . SectionIdxs . Length - 1 ] . Y - trackShape . SectionIdxs [ 0 ] . Y ) ;
159162 }
160163 else
161164 {
162- OffsetPos = CenterOffsetComponent = CenterOffset . X ;
165+ OffsetPos = CenterOffset . X ;
163166 Span = ( float ) ( trackShape . SectionIdxs [ trackShape . SectionIdxs . Length - 1 ] . X - trackShape . SectionIdxs [ 0 ] . X ) ;
164167 }
165168 }
You can’t perform that action at this time.
0 commit comments