X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fannouncer.qc;h=a2e13be53d12bd8901437715a28451a8aedc1c39;hb=e9e91f9bc18dd5002e60c595c83cb8f45068a14b;hp=e20557fa741300f05bb7dfd5027a7832f5b70638;hpb=3ae1efa7401791e42e3171f4db2cc2d38adde088;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/announcer.qc b/qcsrc/client/announcer.qc index e20557fa7..a2e13be53 100644 --- a/qcsrc/client/announcer.qc +++ b/qcsrc/client/announcer.qc @@ -1,10 +1,20 @@ #include "announcer.qh" +#include "mutators/events.qh" + #include "../common/notifications.qh" #include "../common/stats.qh" bool announcer_1min; bool announcer_5min; +string AnnouncerOption() +{ + if(MUTATOR_CALLHOOK(AnnouncerOption, ret_string)) + return ret_string; + + return autocvar_cl_announcer; +} + void Announcer_Countdown() { SELFPARAM(); @@ -68,19 +78,18 @@ void Announcer_Gamestart() { if(time < startTime) { - entity e = find(world, classname, "announcer_countdown"); - if (!e) + static entity announcer_countdown; + if (!announcer_countdown) { - e = spawn(); - e.classname = "announcer_countdown"; - e.think = Announcer_Countdown; + announcer_countdown = new(announcer_countdown); + announcer_countdown.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 + if(time > announcer_countdown.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 + announcer_countdown.nextthink = startTime - floor(startTime - time); //synchronize nextthink to startTime } }