@@ -263,11 +263,6 @@ public string Map {
263263 /// </summary>
264264 public bool IsHeaderCorrupted { get ; private set ; }
265265
266- /// <summary>
267- /// Used to sample gap in ticks when header is corrupted
268- /// </summary>
269- internal List < int > TickGaps = new List < int > ( ) ;
270-
271266 /// <summary>
272267 /// Gets the participants of this game
273268 /// </summary>
@@ -458,6 +453,7 @@ public float TickRate {
458453 /// How long a tick of the demo is in s^-1
459454 /// </summary>
460455 /// <value>The tick time.</value>
456+ private List < int > tickGaps = new List < int > ( ) ;
461457 private float _ticktime ;
462458 public float TickTime {
463459 get { return IsHeaderCorrupted ? _ticktime : this . Header . PlaybackTime / this . Header . PlaybackFrames ; }
@@ -575,12 +571,12 @@ public void ParseToEnd(CancellationToken token)
575571 private void FixTickTime ( )
576572 {
577573 // at the beginning of demos the tickgap can be erratic, so make sure we have 10 consecutive that are the same
578- int gap = TickGaps [ 1 ] - TickGaps [ 0 ] ;
574+ int gap = tickGaps [ 1 ] - tickGaps [ 0 ] ;
579575 bool isConsecutive = true ;
580- for ( int i = 1 ; i < TickGaps . Count - 1 ; i ++ ) {
581- if ( TickGaps [ i + 1 ] - TickGaps [ i ] != gap )
576+ for ( int i = 1 ; i < tickGaps . Count - 1 ; i ++ ) {
577+ if ( tickGaps [ i + 1 ] - tickGaps [ i ] != gap )
582578 {
583- TickGaps . Clear ( ) ;
579+ tickGaps . Clear ( ) ;
584580 isConsecutive = false ;
585581 break ;
586582 }
@@ -603,11 +599,11 @@ public bool ParseNextTick()
603599 if ( Header == null )
604600 throw new InvalidOperationException ( "You need to call ParseHeader first before you call ParseToEnd or ParseNextTick!" ) ;
605601
606- int consecutiveGaps = 10 ;
607602 if ( IsHeaderCorrupted && _ticktime == 0 && IngameTick > 20 ) {
608- if ( TickGaps . Count < consecutiveGaps )
609- TickGaps . Add ( IngameTick ) ;
610- else if ( TickGaps . Count == consecutiveGaps ) {
603+ int consecutiveGaps = 10 ;
604+ if ( tickGaps . Count < consecutiveGaps )
605+ tickGaps . Add ( IngameTick ) ;
606+ else if ( tickGaps . Count == consecutiveGaps ) {
611607 FixTickTime ( ) ;
612608 }
613609 }
0 commit comments