]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sbar.c
added #define _FILE_OFFSET_BITS 64 to reduce problems with video recording on 32bit...
[xonotic/darkplaces.git] / sbar.c
diff --git a/sbar.c b/sbar.c
index d145da2849a8abb6125c09e39864267a2d88a3d1..2e1140ac50e4731c23f1d8e89150c8d698ae42f5 100644 (file)
--- a/sbar.c
+++ b/sbar.c
@@ -175,10 +175,10 @@ void sbar_start(void)
 
                sb_items[11] = Draw_CachePic ("gfx/sb_flag_red_taken", true);
                sb_items[12] = Draw_CachePic ("gfx/sb_flag_red_lost", true);
-               sb_items[13] = Draw_CachePic ("gfx/sb_flag_red_carring", true);
+               sb_items[13] = Draw_CachePic ("gfx/sb_flag_red_carrying", true);
                sb_items[15] = Draw_CachePic ("gfx/sb_flag_blue_taken", true);
                sb_items[16] = Draw_CachePic ("gfx/sb_flag_blue_lost", true);
-               sb_items[17] = Draw_CachePic ("gfx/sb_flag_blue_carring", true);
+               sb_items[17] = Draw_CachePic ("gfx/sb_flag_blue_carrying", true);
 
                sb_sbar = Draw_CachePic("gfx/sbar", true);
                sb_sbar_minimal = Draw_CachePic("gfx/sbar_minimal", true);
@@ -1119,6 +1119,7 @@ void Sbar_Draw (void)
                                int i;
                                double time;
                                float fade;
+                               int redflag, blueflag;
 
                                // we have a max time 2s (min time = 0)
                                if ((time = cl.time - cl.weapontime) < 2)
@@ -1142,10 +1143,10 @@ void Sbar_Draw (void)
                                        Sbar_DrawAlphaPic (0, 0, sb_sbar_minimal, sbar_alpha_fg.value);
 
                                // flag icons
-                               int redflag = ((cl.stats[STAT_ITEMS]>>15) & 3);
+                               redflag = ((cl.stats[STAT_ITEMS]>>15) & 3);
                                if (redflag)
                                        Sbar_DrawPic (10, -85, sb_items[redflag+10]);
-                               int blueflag = ((cl.stats[STAT_ITEMS]>>17) & 3);
+                               blueflag = ((cl.stats[STAT_ITEMS]>>17) & 3);
                                if (blueflag)
                                        Sbar_DrawPic (10, -145, sb_items[blueflag+14]);
 
@@ -1399,9 +1400,9 @@ float Sbar_PrintScoreboardItem(scoreboard_t *s, float x, float y)
                if (s->qw_spectator)
                {
                        if (s->qw_ping || s->qw_packetloss)
-                               DrawQ_ColoredString(x, y, va("%4i %3i %4i spectator  %c%s", bound(0, s->qw_ping, 9999), bound(0, s->qw_packetloss, 99), minutes, cl.qw_teamplay ? s->qw_team : "", (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL );
+                               DrawQ_ColoredString(x, y, va("%4i %3i %4i spectator  %c%s", bound(0, s->qw_ping, 9999), bound(0, s->qw_packetloss, 99), minutes, (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL );
                        else
-                               DrawQ_ColoredString(x, y, va("         %4i spectator  %c%s", minutes, cl.qw_teamplay ? s->qw_team : "", (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL );
+                               DrawQ_ColoredString(x, y, va("         %4i spectator  %c%s", minutes, (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL );
                }
                else
                {
@@ -1461,9 +1462,20 @@ void Sbar_DeathmatchOverlay (void)
                else if (cls.protocol == PROTOCOL_QUAKE || cls.protocol == PROTOCOL_QUAKEDP || cls.protocol == PROTOCOL_NEHAHRAMOVIE || cls.protocol == PROTOCOL_DARKPLACES1 || cls.protocol == PROTOCOL_DARKPLACES2 || cls.protocol == PROTOCOL_DARKPLACES3 || cls.protocol == PROTOCOL_DARKPLACES4 || cls.protocol == PROTOCOL_DARKPLACES5 || cls.protocol == PROTOCOL_DARKPLACES6 || cls.protocol == PROTOCOL_DARKPLACES7)
                {
                        // these servers usually lack the pings command and so a less efficient "ping" command must be sent, which on modern DP servers will also reply with a pingplreport command after the ping listing
-                       cl.parsingtextexpectingpingforscores = true; // hide the output of the next ping report
-                       MSG_WriteByte(&cls.netcon->message, clc_stringcmd);
-                       MSG_WriteString(&cls.netcon->message, "ping");
+                       static int ping_anyway_counter = 0;
+                       if(cl.parsingtextexpectingpingforscores == 1)
+                       {
+                               Con_DPrintf("want to send ping, but still waiting for other reply\n");
+                               if(++ping_anyway_counter >= 5)
+                                       cl.parsingtextexpectingpingforscores = 0;
+                       }
+                       if(cl.parsingtextexpectingpingforscores != 1)
+                       {
+                               ping_anyway_counter = 0;
+                               cl.parsingtextexpectingpingforscores = 1; // hide the output of the next ping report
+                               MSG_WriteByte(&cls.netcon->message, clc_stringcmd);
+                               MSG_WriteString(&cls.netcon->message, "ping");
+                       }
                }
                else
                {