From bedd8704f2aef5afd1c2acfa4566a0445d3b22fb Mon Sep 17 00:00:00 2001 From: Cyp Date: Mon, 21 May 2012 13:33:45 +0200 Subject: [PATCH] =?UTF-8?q?Be=20more=20consistent=20in=20ping=20display,?= =?UTF-8?q?=20show=20ping=20=E2=89=A5=204000=20as=20=E2=88=9E.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/multiint.cpp | 11 ++++++++++- src/multimenu.cpp | 6 +++--- src/multiplay.h | 2 +- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/multiint.cpp b/src/multiint.cpp index 713e6c86ffd..d33ea06c444 100644 --- a/src/multiint.cpp +++ b/src/multiint.cpp @@ -4089,7 +4089,16 @@ void displayPlayer(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, PIELIGHT *p char buf[250] = {'\0'}; // show "actual" ping time - ssprintf(buf, "%s%s: %03d", subText.empty()? "" : ", ", _("Ping"), ingame.PingTimes[j]); + ssprintf(buf, "%s%s: ", subText.empty()? "" : ", ", _("Ping")); + subText += buf; + if (ingame.PingTimes[j] < PING_LIMIT) + { + ssprintf(buf, "%03d", ingame.PingTimes[j]); + } + else + { + ssprintf(buf, "∞"); // Player has ping of somewhat questionable quality. + } subText += buf; } iV_DrawText(name.c_str(), x + nameX, y + (subText.empty()? 22 : 18)); diff --git a/src/multimenu.cpp b/src/multimenu.cpp index ec4de4ff743..16710380f94 100644 --- a/src/multimenu.cpp +++ b/src/multimenu.cpp @@ -950,13 +950,13 @@ static void displayMultiPlayer(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, //c11:ping if (!isSelectedPlayer && isHuman) { - if (ingame.PingTimes[player] >= 2000) + if (ingame.PingTimes[player] < PING_LIMIT) { - sprintf(str, "???"); + sprintf(str, "%03d", ingame.PingTimes[player]); } else { - sprintf(str, "%d", ingame.PingTimes[player]); + sprintf(str, "∞"); } iV_DrawText(str, x + MULTIMENU_C11, y + MULTIMENU_FONT_OSET); } diff --git a/src/multiplay.h b/src/multiplay.h index a00a05a56a9..1c6953042ae 100644 --- a/src/multiplay.h +++ b/src/multiplay.h @@ -129,7 +129,7 @@ extern UBYTE bDisplayMultiJoiningStatus; // draw load progress? //#define PING_LO 0 // this ping is kickin'. #define PING_MED 200 // this ping is crawlin' #define PING_HI 400 // this ping just plain sucks :P -#define PING_LIMIT 1000 // if ping is bigger than this, then worry and panic. +#define PING_LIMIT 4000 // If ping is bigger than this, then worry and panic, and don't even try showing the ping. #define LEV_LOW 400 // how many points to allocate for res levels??? #define LEV_MED 700