File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ func (p *Player) FlashDurationTimeRemaining() time.Duration {
106106 // TODO: read tickRate from CVARs as fallback
107107 tickRate := p .demoInfoProvider .TickRate ()
108108 if tickRate == 0 {
109- return time . Duration ( p . FlashDuration ) * time . Second
109+ return p . flashDurationTimeFull ()
110110 }
111111
112112 timeSinceFlash := time .Duration (float64 (p .demoInfoProvider .IngameTick ()- p .FlashTick ) / tickRate * float64 (time .Second ))
Original file line number Diff line number Diff line change @@ -92,11 +92,11 @@ func TestPlayer_FlashDurationTimeRemaining_Default(t *testing.T) {
9292}
9393
9494func TestPlayer_FlashDurationTimeRemaining (t * testing.T ) {
95- pl := newPlayer (128 * 2 )
95+ pl := newPlayer (32 * 5 )
9696
9797 pl .FlashDuration = 3
9898 pl .FlashTick = 128
99- assert .Equal (t , 2 * time .Second , pl .FlashDurationTimeRemaining ())
99+ assert .Equal (t , 2750 * time .Millisecond , pl .FlashDurationTimeRemaining ())
100100}
101101
102102func TestPlayer_FlashDurationTimeRemaining_Zero (t * testing.T ) {
@@ -118,9 +118,9 @@ func TestPlayer_FlashDurationTimeRemaining_FlashDuration_Over(t *testing.T) {
118118func TestPlayer_FlashDurationTimeRemaining_Fallback (t * testing.T ) {
119119 pl := NewPlayer (mockDemoInfoProvider (0 , 128 ))
120120
121- pl .FlashDuration = 2
122- pl .FlashTick = 128 * 2
123- assert .Equal (t , 2 * time .Second , pl .FlashDurationTimeRemaining ())
121+ pl .FlashDuration = 2.7
122+ pl .FlashTick = 128 * 3
123+ assert .Equal (t , 2700 * time .Millisecond , pl .FlashDurationTimeRemaining ())
124124}
125125
126126func TestPlayer_IsSpottedBy_HasSpotted_True (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments