From: terencehill Date: Wed, 2 Aug 2017 11:03:22 +0000 (+0200) Subject: Clean up HUD_Mod_Race a little bit X-Git-Tag: xonotic-v0.8.5~2548 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b391c0391598ea991409c0ddfbf4abb09d3fda51;p=xonotic%2Fxonotic-data.pk3dir.git Clean up HUD_Mod_Race a little bit --- diff --git a/qcsrc/client/hud/panel/modicons.qc b/qcsrc/client/hud/panel/modicons.qc index e8464cc14..03ab7a425 100644 --- a/qcsrc/client/hud/panel/modicons.qc +++ b/qcsrc/client/hud/panel/modicons.qc @@ -513,10 +513,8 @@ void race_showTime(string text, vector pos, vector timeText_ofs, float theTime, void HUD_Mod_Race(vector pos, vector mySize) { - entity me; - me = playerslots[player_localnum]; - float score; - score = me.(scores(ps_primary)); + entity me = playerslots[player_localnum]; + float score = me.(scores(ps_primary)); if(!(scores_flags(ps_primary) & SFL_TIME) || teamplay) // race/cts record display on HUD { @@ -589,24 +587,15 @@ void HUD_Mod_Race(vector pos, vector mySize) } // race "awards" - float a; - a = bound(0, race_status_time - time, 1); + float a = bound(0, race_status_time - time, 1); + string s = textShortenToWidth(ColorTranslateRGB(race_status_name), squareSize, '1 1 0' * 0.1 * squareSize, stringwidth_colors); - string s; - s = textShortenToWidth(ColorTranslateRGB(race_status_name), squareSize, '1 1 0' * 0.1 * squareSize, stringwidth_colors); - - float rank; + float rank = 0; if(race_status > 0) rank = race_CheckName(race_status_name); - else - rank = 0; - string rankname; - rankname = count_ordinal(rank); - - vector namepos; - namepos = medalPos + '0 0.8 0' * squareSize; - vector rankpos; - rankpos = medalPos + '0 0.15 0' * squareSize; + string rankname = count_ordinal(rank); + vector namepos = medalPos + '0 0.8 0' * squareSize; + vector rankpos = medalPos + '0 0.15 0' * squareSize; if(race_status == 0) drawpic_aspect_skin(medalPos, "race_newfail", '1 1 0' * squareSize, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);