]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix compilation unit test
authorMario <mario.mario@y7mail.com>
Fri, 1 Jul 2022 05:16:30 +0000 (15:16 +1000)
committerMario <mario.mario@y7mail.com>
Fri, 1 Jul 2022 05:16:30 +0000 (15:16 +1000)
qcsrc/common/gamemodes/gamemode/tka/sv_tka.qc
qcsrc/common/gamemodes/gamemode/tka/sv_tka.qh

index a09b655b3ac66b64391dae5a1250786e93299d98..6054df7f4b942a196f72603049840f1503004880 100644 (file)
@@ -563,3 +563,18 @@ MUTATOR_HOOKFUNCTION(tka, TeamBalance_CheckAllowedTeams, CBC_ORDER_EXCLUSIVE)
        M_ARGV(0, float) = tka_teams;
        return true;
 }
+
+void tka_Initialize()
+{
+       tka_teams = autocvar_g_tka_teams_override;
+       if(tka_teams < 2)
+               tka_teams = cvar("g_tka_teams"); // read the cvar directly as it gets written earlier in the same frame
+       tka_teams = BITS(bound(2, tka_teams, 4));
+       GameRules_scoring(tka_teams, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, {
+               field(SP_TKA_PICKUPS, "pickups", 0);
+               field(SP_TKA_CARRIERKILLS, "bckills", 0);
+               field(SP_TKA_BCTIME, "bctime", SFL_SORT_PRIO_SECONDARY);
+       });
+
+       InitializeEntity(NULL, tka_DelayedInit, INITPRIO_GAMETYPE);
+}
index a24b5c5ca3a632f24f1613948b84374544a91f66..61ec7a942e7232fa67be6eb38ce198b5fe884e2c 100644 (file)
@@ -4,7 +4,7 @@
 int autocvar_g_tka_point_limit;
 int autocvar_g_tka_point_leadlimit;
 bool autocvar_g_tka_team_spawns;
-void tka_DelayedInit(entity this);
+void tka_Initialize();
 
 int tka_teams;
 //int autocvar_g_tka_teams;
@@ -21,17 +21,7 @@ REGISTER_MUTATOR(tka, false)
                GameRules_limit_score(autocvar_g_tka_point_limit);
         GameRules_limit_lead(autocvar_g_tka_point_leadlimit);
 
-        tka_teams = autocvar_g_tka_teams_override;
-        if(tka_teams < 2)
-               tka_teams = cvar("g_tka_teams"); // read the cvar directly as it gets written earlier in the same frame
-        tka_teams = BITS(bound(2, tka_teams, 4));
-           GameRules_scoring(tka_teams, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, {
-            field(SP_TKA_PICKUPS, "pickups", 0);
-            field(SP_TKA_CARRIERKILLS, "bckills", 0);
-            field(SP_TKA_BCTIME, "bctime", SFL_SORT_PRIO_SECONDARY);
-        });
-
-               InitializeEntity(NULL, tka_DelayedInit, INITPRIO_GAMETYPE);
+        tka_Initialize();
        }
        return false;
 }