From 04852fe26cf701d01c27af9c1b551815ddb2e30e Mon Sep 17 00:00:00 2001 From: Mircea Kitsune Date: Sat, 6 Oct 2012 15:44:37 +0300 Subject: [PATCH] Don't show a negative value while the server is respawning the player --- qcsrc/client/scoreboard.qc | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/qcsrc/client/scoreboard.qc b/qcsrc/client/scoreboard.qc index 9bc340abc..41ac0a727 100644 --- a/qcsrc/client/scoreboard.qc +++ b/qcsrc/client/scoreboard.qc @@ -1379,19 +1379,21 @@ void HUD_DrawScoreboard() // print information about respawn status float respawn_time = getstatf(STAT_RESPAWN_TIME); - if(respawn_time) + if(respawn_time < 0) { - 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 + // 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 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"); - + 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) + { 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); } -- 2.39.2