]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/teamplay.qc
Merge branch 'master' into terencehill/centerprint_stuff
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / teamplay.qc
index ab8eee07534f0d1a7ab079e58d0e5bbd418ac688..310bd81cd415be25447f2e6659337d88c785962e 100644 (file)
@@ -455,8 +455,6 @@ void PrintWelcomeMessage(entity pl)
 {
        string s, modifications, motd;
 
-       if(self.cvar_scr_centertime == 0) return;
-
        if(autocvar_g_campaign)
        {
                if(self.classname == "player" && !self.BUTTON_INFO)
@@ -468,11 +466,6 @@ void PrintWelcomeMessage(entity pl)
                        return;
        }
 
-       if( !(timeoutStatus >= 1) ) { //really print the WelcomeMessage to the player every frame when timeout-seconds are shown or the game is restarted, to make sure that the shown number is accurate
-               if(self.welcomemessage_time > time) return;
-               self.welcomemessage_time = time + max(0.5, self.cvar_scr_centertime * 0.6);
-       }
-
        if(autocvar_g_campaign)
        {
                centerprint(pl, campaign_message);
@@ -484,19 +477,18 @@ void PrintWelcomeMessage(entity pl)
        {
                // TODO get rid of this too
                local string specString;
-               specString = NEWLINES;
                //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 = strcat(specString, "\n\n", getTimeoutText(1));
+                       specString = getTimeoutText(1);
                else
                {
                        if(self.classname == "player")
                                return;
                        goto normal;
                }
-               return centerprint_atprio(self, CENTERPRIO_SPAM, specString);
+               return centerprint_atprio(self, CENTERPRIO_SPAM, specString); // TODO: convert to Send_CSQC_Centerprint_Generic(self, CPID_TIMEOUT_COUNTDOWN, ...
        }
 
 :normal
@@ -536,7 +528,7 @@ void PrintWelcomeMessage(entity pl)
        local string versionmessage;
        versionmessage = GetClientVersionMessage();
 
-       s = strcat(s, NEWLINES, "This is Xonotic ", autocvar_g_xonoticversion, "\n", versionmessage);
+       s = strcat("This is Xonotic ", autocvar_g_xonoticversion, "\n", versionmessage);
        s = strcat(s, "^8\n\nmatch type is ^1", gamemode_name, "^8\n");
 
        if(modifications != "")
@@ -568,7 +560,7 @@ void PrintWelcomeMessage(entity pl)
        }
        s = strcat(s, "\n");
 
-       centerprint(pl, s);
+       Send_CSQC_Centerprint_Generic(pl, CPID_MOTD, s, autocvar_welcome_message_time, 0);
 }