X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fhud%2Fpanel%2Fmodicons.qc;h=89b8a8c188b4a981774ed1c173b98e8215c62a78;hb=60b0e81cdaed847a7aac9d234f219937ab9462b2;hp=e87d64c87bb002641fedb5c5884b000593aacb62;hpb=f05eb894b194bc4edbff15f7505a233f195c159c;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/hud/panel/modicons.qc b/qcsrc/client/hud/panel/modicons.qc index e87d64c87b..89b8a8c188 100644 --- a/qcsrc/client/hud/panel/modicons.qc +++ b/qcsrc/client/hud/panel/modicons.qc @@ -1,8 +1,11 @@ #include "modicons.qh" +#include +#include #include #include -#include // TODO: remove +#include +#include // Mod icons (#10) @@ -512,14 +515,16 @@ void race_showTime(string text, vector pos, vector timeText_ofs, float theTime, void HUD_Mod_Race(vector pos, vector mySize) { - mod_active = 1; // race should never hide the mod icons panel - 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 + { + mod_active = 0; // hide it in this case! return; // no records in the actual race + } + + mod_active = 1; // clientside personal record string rr; @@ -578,30 +583,19 @@ void HUD_Mod_Race(vector pos, vector mySize) if (race_status != race_status_prev || race_status_name != race_status_name_prev) { race_status_time = time + 5; race_status_prev = race_status; - if (race_status_name_prev) - strunzone(race_status_name_prev); - race_status_name_prev = strzone(race_status_name); + strcpy(race_status_name_prev, race_status_name); } // 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); @@ -625,12 +619,8 @@ void HUD_Mod_Race(vector pos, vector mySize) if (race_status_time - time <= 0) { race_status_prev = -1; race_status = -1; - if(race_status_name) - strunzone(race_status_name); - race_status_name = string_null; - if(race_status_name_prev) - strunzone(race_status_name_prev); - race_status_name_prev = string_null; + strfree(race_status_name); + strfree(race_status_name_prev); } }