From: Mario Date: Wed, 14 Oct 2015 14:44:16 +0000 (+1000) Subject: Shoot down another gamemode specific check X-Git-Tag: xonotic-v0.8.2~1801^2~23 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=69e67618c3c8c9e0b4b2818ab1041fdee13ea81d;p=xonotic%2Fxonotic-data.pk3dir.git Shoot down another gamemode specific check --- diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index e8edabc2c..c01aca479 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -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 == "") { diff --git a/qcsrc/server/mutators/events.qh b/qcsrc/server/mutators/events.qh index c6815e7fb..a9f8b8a99 100644 --- a/qcsrc/server/mutators/events.qh +++ b/qcsrc/server/mutators/events.qh @@ -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 diff --git a/qcsrc/server/mutators/gamemode_ca.qc b/qcsrc/server/mutators/gamemode_ca.qc index 2e380510f..1a9b1daa1 100644 --- a/qcsrc/server/mutators/gamemode_ca.qc +++ b/qcsrc/server/mutators/gamemode_ca.qc @@ -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; diff --git a/qcsrc/server/mutators/gamemode_freezetag.qc b/qcsrc/server/mutators/gamemode_freezetag.qc index 287f50702..d6c8d2941 100644 --- a/qcsrc/server/mutators/gamemode_freezetag.qc +++ b/qcsrc/server/mutators/gamemode_freezetag.qc @@ -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;