]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Improve last commit, and show a separate text while the server is working on respawni...
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 6 Oct 2012 12:54:50 +0000 (15:54 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 6 Oct 2012 12:54:50 +0000 (15:54 +0300)
qcsrc/client/scoreboard.qc

index 41ac0a72771bb38a466f0e16a291062ff8b4b387..913a0bfb34b2eef4d87dc640ae0636b9e199681b 100644 (file)
@@ -1379,21 +1379,22 @@ void HUD_DrawScoreboard()
 
        // print information about respawn status
        float respawn_time = getstatf(STAT_RESPAWN_TIME);
-       if(respawn_time < 0)
-       {
-               // a negative number means we are awaiting respawn, time value is still the same
-               respawn_time *= -1; // remove mark now that we checked it
-               if(respawn_time - time > 0)
-                       str = strcat("^1Respawning in ^3", ftos_decimals(respawn_time - time, 2), "^1 seconds...");
-               else
-                       respawn_time = 0; // don't show a negative value while the server is respawning the player
-       }
-       else if(time < respawn_time)
-               str = strcat("You are dead, wait ^3", ftos_decimals(respawn_time - time, 2), "^7 seconds before respawning");
-       else if(time >= respawn_time)
-               str = strcat("You are dead, press ^2", getcommandkey("primary fire", "+fire"), "^7 to respawn");
        if(respawn_time)
        {
+               if(respawn_time < 0)
+               {
+                       // a negative number means we are awaiting respawn, time value is still the same
+                       respawn_time *= -1; // remove mark now that we checked it
+                       if(time >= respawn_time) // don't show a negative value while the server is respawning the player (lag)
+                               str = strcat("^1Respawning...");
+                       else
+                               str = strcat("^1Respawning in ^3", ftos_decimals(respawn_time - time, 2), "^1 seconds...");
+               }
+               else if(time < respawn_time)
+                       str = strcat("You are dead, wait ^3", ftos_decimals(respawn_time - time, 2), "^7 seconds before respawning");
+               else if(time >= respawn_time)
+                       str = strcat("You are dead, press ^2", getcommandkey("primary fire", "+fire"), "^7 to respawn");
+
                pos_y += 1.2 * hud_fontsize_y;
                drawcolorcodedstring(pos + '0.5 0 0' * (sbwidth - stringwidth(str, TRUE, hud_fontsize)), str, hud_fontsize, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
        }