]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/gamemodes/gamemode/keepaway/sv_keepaway.qh
keepaway: fix bug where on certain maps the ball had no proper bbox
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / gamemodes / gamemode / keepaway / sv_keepaway.qh
index 2f1f0764397fe9308810a148e0f36ab5ee4a7559..38dd56197fc14028a50dee2241f2ed18707f3f36 100644 (file)
@@ -2,7 +2,8 @@
 
 #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)
@@ -16,15 +17,16 @@ REGISTER_MUTATOR(ka, false)
             field(SP_KEEPAWAY_BCTIME, "bctime", SFL_SORT_PRIO_SECONDARY);
         });
 
-               ka_Initialize();
+               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;