]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/teamplay.qc
Merge branch 'maint' (early part before Transifex)
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / teamplay.qc
index 72e065485d250def25eeb9f43e9a7309b3249fff..b19597cdeb05c7c679bff8f537b64b94abc19ba9 100644 (file)
@@ -1,40 +1,25 @@
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-       #include "../dpdefs/progsdefs.qc"
-    #include "../dpdefs/dpextensions.qc"
-    #include "sys-post.qh"
-    #include "../common/constants.qh"
-    #include "../common/teams.qh"
-    #include "../common/util.qh"
-    #include "autocvars.qh"
-    #include "defs.qh"
-    #include "../common/notifications.qh"
-    #include "../common/deathtypes.qh"
-    #include "mutators/mutators_include.qh"
-    #include "../common/mapinfo.qh"
-    #include "command/vote.qh"
-    #include "scores.qh"
-    #include "race.qh"
-#endif
-
-string cache_mutatormsg;
-string cache_lastmutatormsg;
-
-// client counts for each team
-//float c1, c2, c3, c4;
-// # of bots on those teams
-float cb1, cb2, cb3, cb4;
-
-//float audit_teams_time;
+#include "teamplay.qh"
+#include "_all.qh"
+
+#include "cl_client.qh"
+#include "race.qh"
+#include "scores.qh"
+#include "scores_rules.qh"
+
+#include "bot/bot.qh"
+
+#include "command/vote.qh"
+
+#include "mutators/mutators_include.qh"
+
+#include "../common/deathtypes.qh"
+#include "../common/teams.qh"
 
 void TeamchangeFrags(entity e)
 {
        PlayerScore_Clear(e);
 }
 
-void entcs_init();
-
 void LogTeamchange(float player_id, float team_number, float type)
 {
        if(!autocvar_sv_eventlog)
@@ -56,6 +41,7 @@ void ActivateTeamplay()
 {
        serverflags |= SERVERFLAG_TEAMPLAY;
        teamplay = 1;
+       cvar_set("teamplay", "2");  // DP needs this for sending proper getstatus replies.
 }
 
 void InitGameplayMode()
@@ -72,8 +58,9 @@ void InitGameplayMode()
        world.maxs = mi_max;
 
        MapInfo_LoadMapSettings(mapname);
-       teamplay = 0;
        serverflags &= ~SERVERFLAG_TEAMPLAY;
+       teamplay = 0;
+       cvar_set("teamplay", "0");  // DP needs this for sending proper getstatus replies.
 
        if (!cvar_value_issafe(world.fog))
        {
@@ -296,8 +283,7 @@ string getwelcomemessage(void)
 {
        string s, modifications, motd;
 
-       ret_string = "";
-       MUTATOR_CALLHOOK(BuildMutatorsPrettyString);
+       MUTATOR_CALLHOOK(BuildMutatorsPrettyString, "");
        modifications = ret_string;
 
        if(g_weaponarena)
@@ -445,8 +431,7 @@ void CheckAllowedTeams (entity for_whom)
                // cover anything else by treating it like tdm with no teams spawned
                dm = 2;
 
-               ret_float = dm;
-               MUTATOR_CALLHOOK(GetTeamCount);
+               MUTATOR_CALLHOOK(GetTeamCount, dm);
                dm = ret_float;
 
                if(dm >= 4)