]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
GetTeamCount --> CheckAllowedTeams
authorterencehill <piuntn@gmail.com>
Sat, 10 Sep 2016 12:48:00 +0000 (14:48 +0200)
committerterencehill <piuntn@gmail.com>
Sat, 10 Sep 2016 12:48:00 +0000 (14:48 +0200)
13 files changed:
qcsrc/common/gamemodes/gamemode/nexball/nexball.qc
qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc
qcsrc/server/mutators/events.qh
qcsrc/server/mutators/mutator/gamemode_assault.qc
qcsrc/server/mutators/mutator/gamemode_ca.qc
qcsrc/server/mutators/mutator/gamemode_ctf.qc
qcsrc/server/mutators/mutator/gamemode_domination.qc
qcsrc/server/mutators/mutator/gamemode_freezetag.qc
qcsrc/server/mutators/mutator/gamemode_invasion.qc
qcsrc/server/mutators/mutator/gamemode_keyhunt.qc
qcsrc/server/mutators/mutator/gamemode_race.qc
qcsrc/server/mutators/mutator/gamemode_tdm.qc
qcsrc/server/teamplay.qc

index 0054fd63607b1523c5b729382e1fe52c593da6d9..1d2555e95e9c9750dd5ef146f2356bad7bf40286 100644 (file)
@@ -1086,7 +1086,7 @@ MUTATOR_HOOKFUNCTION(nb, ItemTouch)
        return MUT_ITEMTOUCH_CONTINUE;
 }
 
-MUTATOR_HOOKFUNCTION(nb, GetTeamCount)
+MUTATOR_HOOKFUNCTION(nb, CheckAllowedTeams)
 {
        M_ARGV(1, string) = "nexball_team";
        return true;
index 8e60bc30897a4ac897ea19c594630b68987989a3..28fcaeb9d0ac19f95414f950b2eb1598772f4eee 100644 (file)
@@ -1871,7 +1871,7 @@ MUTATOR_HOOKFUNCTION(ons, HavocBot_ChooseRole)
        return true;
 }
 
-MUTATOR_HOOKFUNCTION(ons, GetTeamCount)
+MUTATOR_HOOKFUNCTION(ons, CheckAllowedTeams)
 {
        // onslaught is special
        for(entity tmp_entity = ons_worldgeneratorlist; tmp_entity; tmp_entity = tmp_entity.ons_worldgeneratornext)
index c8c3415561248834da720ca1858b64c26c8469b0..e27f1adf44fa6255007fa6e76a460df43c5ae846 100644 (file)
@@ -99,13 +99,13 @@ MUTATOR_HOOKABLE(GiveFragsForKill, EV_GiveFragsForKill);
 MUTATOR_HOOKABLE(MatchEnd, EV_NO_ARGS);
 
 /** should adjust number to contain the team count */
-#define EV_GetTeamCount(i, o) \
+#define EV_CheckAllowedTeams(i, o) \
     /** number of teams    */ i(float, MUTATOR_ARGV_0_float) \
     /**/                      o(float, MUTATOR_ARGV_0_float) \
     /** team entity name   */ i(string, MUTATOR_ARGV_1_string) \
     /**/                      o(string, MUTATOR_ARGV_1_string) \
     /**/
-MUTATOR_HOOKABLE(GetTeamCount, EV_GetTeamCount);
+MUTATOR_HOOKABLE(CheckAllowedTeams, EV_CheckAllowedTeams);
 
 /** copies variables for spectating "spectatee" to "this" */
 #define EV_SpectateCopy(i, o) \
index f4566a9ca667b305a759e05fcf96edf9dc7c6e4c..10a8f644f89c7e2389c4c879ede4db57e485eef2 100644 (file)
@@ -562,7 +562,7 @@ MUTATOR_HOOKFUNCTION(as, PlayHitsound)
        return (frag_victim.classname == "func_assault_destructible");
 }
 
-MUTATOR_HOOKFUNCTION(as, GetTeamCount)
+MUTATOR_HOOKFUNCTION(as, CheckAllowedTeams)
 {
        // assault always has 2 teams
        c1 = c2 = 0;
index 84f668bab5f9954db2cb331a8adef632fa894746..ebfcd9540282d99f853c94cbb6c0f5d94ca75d04 100644 (file)
@@ -226,7 +226,7 @@ MUTATOR_HOOKFUNCTION(ca, reset_map_global)
        return true;
 }
 
-MUTATOR_HOOKFUNCTION(ca, GetTeamCount, CBC_ORDER_EXCLUSIVE)
+MUTATOR_HOOKFUNCTION(ca, CheckAllowedTeams, CBC_ORDER_EXCLUSIVE)
 {
        M_ARGV(0, float) = ca_teams;
 }
index 56ee04d5dafe61135f3c2acc1fb6b6bed70fd5ac..0a3c622a9b0a3575f2d73c570e2866505362ec60 100644 (file)
@@ -2369,7 +2369,7 @@ MUTATOR_HOOKFUNCTION(ctf, HavocBot_ChooseRole)
        return true;
 }
 
-MUTATOR_HOOKFUNCTION(ctf, GetTeamCount)
+MUTATOR_HOOKFUNCTION(ctf, CheckAllowedTeams)
 {
        //M_ARGV(0, float) = ctf_teams;
        M_ARGV(1, string) = "ctf_team";
index abcae5ada5dffb2db2381386b8a9d0a23627d5b4..eb94e4f263f75a57b21b0e0a1cb8b5b52d197fd5 100644 (file)
@@ -411,7 +411,7 @@ void havocbot_role_dom(entity this)
        }
 }
 
-MUTATOR_HOOKFUNCTION(dom, GetTeamCount)
+MUTATOR_HOOKFUNCTION(dom, CheckAllowedTeams)
 {
        // fallback?
        M_ARGV(0, float) = domination_teams;
index cd7372699004bd93fe18e482e69d552e5b24f27d..0143760872504e1fbc6a143714b6bc2e5eba47fb 100644 (file)
@@ -553,7 +553,7 @@ MUTATOR_HOOKFUNCTION(ft, HavocBot_ChooseRole)
        return true;
 }
 
-MUTATOR_HOOKFUNCTION(ft, GetTeamCount, CBC_ORDER_EXCLUSIVE)
+MUTATOR_HOOKFUNCTION(ft, CheckAllowedTeams, CBC_ORDER_EXCLUSIVE)
 {
        M_ARGV(0, float) = freezetag_teams;
 }
index 2a1b35956b0bce2b42d6b6156629acf93c751683..515148c1bbdc06625c5b8161892785ac42014686 100644 (file)
@@ -412,7 +412,7 @@ MUTATOR_HOOKFUNCTION(inv, AllowMobSpawning)
        return true;
 }
 
-MUTATOR_HOOKFUNCTION(inv, GetTeamCount, CBC_ORDER_EXCLUSIVE)
+MUTATOR_HOOKFUNCTION(inv, CheckAllowedTeams, CBC_ORDER_EXCLUSIVE)
 {
        M_ARGV(0, float) = invasion_teams;
 }
index 96d2c541dadb6ecb66fd8f8a96bf12d610d3c7a9..781609a9106cf977ed9d5e3a68dccb0592fc1684 100644 (file)
@@ -1273,7 +1273,7 @@ MUTATOR_HOOKFUNCTION(kh, MatchEnd)
        kh_finalize();
 }
 
-MUTATOR_HOOKFUNCTION(kh, GetTeamCount, CBC_ORDER_EXCLUSIVE)
+MUTATOR_HOOKFUNCTION(kh, CheckAllowedTeams, CBC_ORDER_EXCLUSIVE)
 {
        M_ARGV(0, float) = kh_teams;
 }
index b791a69dce9830cc42b45743501dce63bbc80ff1..abe6b846e73fb714e4f132bef49ff7df0d89cd4d 100644 (file)
@@ -343,7 +343,7 @@ MUTATOR_HOOKFUNCTION(rc, ForbidPlayerScore_Clear)
                return true; // in qualifying, you don't lose score by observing
 }
 
-MUTATOR_HOOKFUNCTION(rc, GetTeamCount, CBC_ORDER_EXCLUSIVE)
+MUTATOR_HOOKFUNCTION(rc, CheckAllowedTeams, CBC_ORDER_EXCLUSIVE)
 {
        M_ARGV(0, float) = race_teams;
 }
index d906c1988c247c6bf4f4353da149d31006e5e192..101f57fcc4d6efb96ecd5d2ed5157b0065c29060 100644 (file)
@@ -57,7 +57,7 @@ void tdm_DelayedInit(entity this)
        }
 }
 
-MUTATOR_HOOKFUNCTION(tdm, GetTeamCount, CBC_ORDER_EXCLUSIVE)
+MUTATOR_HOOKFUNCTION(tdm, CheckAllowedTeams, CBC_ORDER_EXCLUSIVE)
 {
        M_ARGV(1, string) = "tdm_team";
        return true;
index de7f2f992617320717d079bd86ea8c8c68f91ed6..6ccb7d408186a2c473c4860bd7a210860e9deea2 100644 (file)
@@ -216,23 +216,23 @@ void SetPlayerTeam(entity pl, float t, float s, float noprint)
 // set c1...c4 to show what teams are allowed
 void CheckAllowedTeams (entity for_whom)
 {
-       int dm = 0;
+       int teams_mask = 0;
 
        c1 = c2 = c3 = c4 = -1;
        cb1 = cb2 = cb3 = cb4 = 0;
 
        string teament_name = string_null;
 
-       bool mutator_returnvalue = MUTATOR_CALLHOOK(GetTeamCount, dm, teament_name);
-       dm = M_ARGV(0, float);
+       bool mutator_returnvalue = MUTATOR_CALLHOOK(CheckAllowedTeams, teams_mask, teament_name);
+       teams_mask = M_ARGV(0, float);
        teament_name = M_ARGV(1, string);
 
        if(!mutator_returnvalue)
        {
-               if(dm & BIT(0)) c1 = 0;
-               if(dm & BIT(1)) c2 = 0;
-               if(dm & BIT(2)) c3 = 0;
-               if(dm & BIT(3)) c4 = 0;
+               if(teams_mask & BIT(0)) c1 = 0;
+               if(teams_mask & BIT(1)) c2 = 0;
+               if(teams_mask & BIT(2)) c3 = 0;
+               if(teams_mask & BIT(3)) c4 = 0;
        }
 
        // find out what teams are allowed if necessary