]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/announcer.qc
Clean up the function slightly (kinda)
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / announcer.qc
index 116dba7d3cc5898bf6acc70f13772e810babdd6c..3ae9f708f9e798206341f31e660cfdcf3a3ee120 100644 (file)
@@ -1,24 +1,29 @@
-#if defined(CSQC)
-       #include "../dpdefs/csprogsdefs.qh"
-    #include "../common/stats.qh"
-    #include "../common/util.qh"
-    #include "autocvars.qh"
-    #include "../common/notifications.qh"
-    #include "main.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "announcer.qh"
+
+#include "mutators/events.qh"
+
+#include "../common/notifications.qh"
+#include "../common/stats.qh"
 
 bool announcer_1min;
 bool announcer_5min;
+string AnnouncerOption()
+{
+       string ret = autocvar_cl_announcer;
+       MUTATOR_CALLHOOK(AnnouncerOption, ret);
+       ret = ret_string;
+       return ret;
+}
+
 void Announcer_Countdown()
 {
+       SELFPARAM();
        float starttime = getstatf(STAT_GAMESTARTTIME);
        float roundstarttime = getstatf(STAT_ROUNDSTARTTIME);
        if(roundstarttime == -1)
        {
                Local_Notification(MSG_CENTER, CENTER_COUNTDOWN_ROUNDSTOP);
-               remove(self);
+               remove(this);
                return;
        }
        if(roundstarttime >= starttime)
@@ -33,7 +38,7 @@ void Announcer_Countdown()
        {
                Local_Notification(MSG_CENTER, CENTER_COUNTDOWN_BEGIN);
                Local_Notification(MSG_MULTI, MULTI_COUNTDOWN_BEGIN);
-               remove(self);
+               remove(this);
                return;
        }
        else // countdown is still going
@@ -50,7 +55,7 @@ void Announcer_Countdown()
                        Local_Notification(MSG_ANNCE, Announcer_PickNumber(CNT_GAMESTART, countdown_rounded));
                }
 
-               self.nextthink = (starttime - (countdown - 1));
+               this.nextthink = (starttime - (countdown - 1));
        }
 }