]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/teamplay.qc
make the match ID more unique
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / teamplay.qc
index 6ef71b98afd7cfb335599863dd339187dc88abe7..c5f8988b94387f795231865cf18464cc8fb38c66 100644 (file)
@@ -12,7 +12,7 @@ float IsTeamBalanceForced()
 {
        if(intermission_running)
                return 0; // no rebalancing whatsoever please
-       if(!teams_matter)
+       if(!teamplay)
                return 0;
        if(autocvar_g_campaign)
                return 0;
@@ -149,7 +149,7 @@ void ReadGameCvars()
                g_tdm = 1;
        }
 
-       teams_matter = 0;
+       teamplay = 0;
        serverflags &~= SERVERFLAG_TEAMPLAY;
 }
 
@@ -162,7 +162,7 @@ void default_delayedinit()
 void ActivateTeamplay()
 {
        serverflags |= SERVERFLAG_TEAMPLAY;
-       teams_matter = 1;
+       teamplay = 1;
 }
 
 void InitGameplayMode()
@@ -382,7 +382,7 @@ void InitGameplayMode()
                MUTATOR_ADD(gamemode_keepaway);
        }
 
-       if(teams_matter)
+       if(teamplay)
                entcs_init();
 
        // save it (for the next startup)
@@ -450,48 +450,10 @@ string GetClientVersionMessage() {
        return versionmsg;
 }
 
-
-void PrintWelcomeMessage(entity pl)
+string getwelcomemessage(void)
 {
        string s, modifications, motd;
 
-       if(autocvar_g_campaign)
-       {
-               if(self.classname == "player" && !self.BUTTON_INFO)
-                       return;
-       }
-       else
-       {
-               if((time - self.jointime) > autocvar_welcome_message_time && !self.BUTTON_INFO)
-                       return;
-       }
-
-       if(autocvar_g_campaign)
-       {
-               centerprint(pl, campaign_message);
-               return;
-       }
-
-//TODO GreEn`mArine: make the timeout-messages clientside as well (just like the ready restart countdown)!
-       if(!self.BUTTON_INFO)
-       {
-               // TODO get rid of this too
-               local string specString;
-               //if(time < game_starttime) //also show the countdown when being a spectator
-               //      specString = strcat(specString, "\n\n^1Game starts in ", ftos(ceil(game_starttime - time)), " seconds^7");
-               //else
-               if (timeoutStatus != 0)
-                       specString = getTimeoutText(1);
-               else
-               {
-                       if(self.classname == "player")
-                               return;
-                       goto normal;
-               }
-               return centerprint_atprio(self, CENTERPRIO_SPAM, specString); // TODO: convert to Send_CSQC_Centerprint_Generic(self, CPID_TIMEOUT_COUNTDOWN, ...
-       }
-
-:normal
        ret_string = "";
        MUTATOR_CALLHOOK(BuildMutatorsPrettyString);
        modifications = ret_string;
@@ -534,9 +496,6 @@ void PrintWelcomeMessage(entity pl)
        if(modifications != "")
                s = strcat(s, "^8\nactive modifications: ^3", modifications, "^8\n");
 
-       if(timeoutStatus != 0)
-               s = strcat(s, "\n\n", getTimeoutText(1));
-
        if (g_grappling_hook)
                s = strcat(s, "\n\n^3grappling hook^8 is enabled, press 'e' to use it\n");
 
@@ -558,12 +517,9 @@ void PrintWelcomeMessage(entity pl)
        if (motd != "") {
                s = strcat(s, "\n\n^8MOTD: ^7", strreplace("\\n", "\n", motd));
        }
-       s = strcat(s, "\n");
-
-       Send_CSQC_Centerprint_Generic(pl, CPID_MOTD, s, autocvar_welcome_message_time, 0);
+       return s;
 }
 
-
 void SetPlayerColors(entity pl, float _color)
 {
        /*string s;
@@ -578,7 +534,7 @@ void SetPlayerColors(entity pl, float _color)
        shirt = _color & 0xF0;
 
 
-       if(teams_matter) {
+       if(teamplay) {
                setcolor(pl, 16*pants + pants);
        } else {
                setcolor(pl, shirt + pants);
@@ -895,7 +851,7 @@ float JoinBestTeam(entity pl, float only_return_best, float forcebestteam)
        float smallest, selectedteam;
 
        // don't join a team if we're not playing a team game
-       if(!teams_matter)
+       if(!teamplay)
                return 0;
 
        // find out what teams are available
@@ -972,7 +928,7 @@ void SV_ChangeTeam(float _color)
        float scolor, dcolor, steam, dteam, dbotcount, scount, dcount;
 
        // in normal deathmatch we can just apply the color and we're done
-       if(!teams_matter) {
+       if(!teamplay) {
                SetPlayerColors(self, _color);
                return;
        }