]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fixed issue where round countdown would start one second too late 951/head
authorz411 <z411@omaera.org>
Wed, 8 Dec 2021 05:18:12 +0000 (02:18 -0300)
committerz411 <z411@omaera.org>
Wed, 8 Dec 2021 05:18:12 +0000 (02:18 -0300)
Due to flooring and not rounding the countdown time, the round timer
would ocassionally start counting one second too late (ie at 9, not 10).

qcsrc/client/announcer.qc

index a0e9b294cd5dec80ca358a709ae50d1ca7f53ca3..109ee5ac1c25cb0e5529cadfd46a527f616a964f 100644 (file)
@@ -107,7 +107,7 @@ void Announcer_Gamestart()
                        if(time > announcer_countdown.nextthink) // don't play it again if countdown was already going
                                Local_Notification(MSG_ANNCE, ANNCE_PREPARE);
 
-                       announcer_countdown.nextthink = startTime - floor(startTime - time); //synchronize nextthink to startTime
+                       announcer_countdown.nextthink = startTime - floor(startTime - time + 0.5); //synchronize nextthink to startTime
                }
        }