From: terencehill Date: Wed, 21 Jan 2015 23:09:21 +0000 (+0100) Subject: Don't play "Prepare for battle" announcement again when countdown to game start ends... X-Git-Tag: xonotic-v0.8.1~152^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6e0bf3c178521b64a30c6eb1cafb7abeb0d2d6ef;p=xonotic%2Fxonotic-data.pk3dir.git Don't play "Prepare for battle" announcement again when countdown to game start ends and countdown to round start begins --- diff --git a/qcsrc/client/announcer.qc b/qcsrc/client/announcer.qc index 350774969..f49b847d6 100644 --- a/qcsrc/client/announcer.qc +++ b/qcsrc/client/announcer.qc @@ -27,6 +27,7 @@ void Announcer_Countdown() } else // countdown is still going { + // if concomitant countdown to round start overrides countdown to game start if(roundstarttime == starttime) { Local_Notification(MSG_CENTER, CENTER_COUNTDOWN_ROUNDSTART, countdown_rounded); @@ -59,9 +60,6 @@ void Announcer_Gamestart() if(previous_game_starttime != startTime) { - if((time + 5.0) < startTime) // if connecting to server while restart was active don't always play prepareforbattle - Local_Notification(MSG_ANNCE, ANNCE_PREPARE); - if(time < startTime) { entity e = find(world, classname, "announcer_countdown"); @@ -71,6 +69,11 @@ void Announcer_Gamestart() e.classname = "announcer_countdown"; e.think = Announcer_Countdown; } + + if(time + 5.0 < startTime) // if connecting to server while restart was active don't always play prepareforbattle + if(time > e.nextthink) // don't play it again if countdown was already going + Local_Notification(MSG_ANNCE, ANNCE_PREPARE); + e.nextthink = startTime - floor(startTime - time); //synchronize nextthink to startTime } }