]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Shoot down another gamemode specific check
authorMario <mario@smbclan.net>
Wed, 14 Oct 2015 14:44:16 +0000 (00:44 +1000)
committerMario <mario@smbclan.net>
Wed, 14 Oct 2015 14:44:16 +0000 (00:44 +1000)
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/events.qh
qcsrc/server/mutators/gamemode_ca.qc
qcsrc/server/mutators/gamemode_freezetag.qc

index e8edabc2c881e9db7666962db09cdd0cacfbdcfb..c01aca47915748159bbc5eb370e30d3c1dca093d 100644 (file)
@@ -547,11 +547,9 @@ void readplayerstartcvars()
        g_weaponarena_weapons = '0 0 0';
 
        s = cvar_string("g_weaponarena");
-       if (s == "0" || s == "")
-       {
-               if(g_ca || g_freezetag)
-                       s = "most";
-       }
+
+       MUTATOR_CALLHOOK(SetWeaponArena, s);
+       s = ret_string;
 
        if (s == "0" || s == "")
        {
index c6815e7fb99c980cf26c00fe587e472765a71353..a9f8b8a9992b8faca90a74f291fb33e429d553f1 100644 (file)
@@ -754,4 +754,10 @@ MUTATOR_HOOKABLE(AddPlayerScore, EV_AddPlayerScore);
     /**/
 entity set_player;
 MUTATOR_HOOKABLE(GetPlayerStatus, EV_GetPlayerStatus);
+
+#define EV_SetWeaponArena(i, o) \
+    /**/ i(string, ret_string) \
+    /**/ o(string, ret_string) \
+    /**/
+MUTATOR_HOOKABLE(SetWeaponArena, EV_SetWeaponArena);
 #endif
index 2e380510f151a1452e938c38478cf7b11f1b9f76..1a9b1daa145d635edb548abdb161af35b5a6af50 100644 (file)
@@ -469,6 +469,14 @@ MUTATOR_HOOKFUNCTION(ca, GetPlayerStatus)
        return false;
 }
 
+MUTATOR_HOOKFUNCTION(ca, SetWeaponArena)
+{
+       // most weapons arena
+       if(ret_string == "0" || ret_string == "")
+               ret_string = "most";
+       return false;
+}
+
 void ca_Initialize()
 {
        allowed_to_spawn = true;
index 287f507024aa868e9e99e2cd32cf1f43b7be7acb..d6c8d2941d1f59667ea06e2645d085f8f0c9ab01 100644 (file)
@@ -584,6 +584,14 @@ MUTATOR_HOOKFUNCTION(ft, GetTeamCount, CBC_ORDER_EXCLUSIVE)
        return false;
 }
 
+MUTATOR_HOOKFUNCTION(ft, SetWeaponArena)
+{
+       // most weapons arena
+       if(ret_string == "0" || ret_string == "")
+               ret_string = "most";
+       return false;
+}
+
 void freezetag_Initialize()
 {
        freezetag_teams = autocvar_g_freezetag_teams_override;