]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/gamemodes/gamemode/keepaway/sv_keepaway.qh
Merge branch 'LegendaryGuard/avoid_spam_map_custom_fields' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / gamemodes / gamemode / keepaway / sv_keepaway.qh
index 2f1f0764397fe9308810a148e0f36ab5ee4a7559..a06a937b10dc40e00fc756a1b9e6ced53fccc77e 100644 (file)
@@ -2,29 +2,31 @@
 
 #include <common/mutators/base.qh>
 #include <common/scores.qh>
-void ka_Initialize();
+
+void ka_Handler_CheckBall(entity this);
 
 IntrusiveList g_kaballs;
 REGISTER_MUTATOR(ka, false)
 {
-    MUTATOR_STATIC();
+       MUTATOR_STATIC();
        MUTATOR_ONADD
        {
-           GameRules_scoring(0, SFL_SORT_PRIO_PRIMARY, 0, {
-            field(SP_KEEPAWAY_PICKUPS, "pickups", 0);
-            field(SP_KEEPAWAY_CARRIERKILLS, "bckills", 0);
-            field(SP_KEEPAWAY_BCTIME, "bctime", SFL_SORT_PRIO_SECONDARY);
-        });
-
-               ka_Initialize();
+               GameRules_scoring(0, SFL_SORT_PRIO_PRIMARY, 0, {
+                       field(SP_KEEPAWAY_PICKUPS, "pickups", 0);
+                       field(SP_KEEPAWAY_CARRIERKILLS, "bckills", 0);
+                       field(SP_KEEPAWAY_BCTIME, "bctime", SFL_SORT_PRIO_SECONDARY);
+               });
+
+               g_kaballs = IL_NEW();
+               entity ka_Handler = new_pure(ka_Handler);
+               setthink(ka_Handler, ka_Handler_CheckBall);
+               InitializeEntity(ka_Handler, ka_Handler_CheckBall, INITPRIO_SETLOCATION);
        }
        return false;
 }
 
 const int KA_BALL_COUNT = 1;
 
-entity ka_Handler;
-
 void(entity this) havocbot_role_ka_carrier;
 void(entity this) havocbot_role_ka_collector;