From 5d43f16fea7f97f3302b89d64c165b7c5b5222dc Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 26 Jan 2013 14:15:34 +0300 Subject: Fix show ping time if timer overflowed and still no response from server. --- src/gui/debugwindow.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'src/gui/debugwindow.cpp') diff --git a/src/gui/debugwindow.cpp b/src/gui/debugwindow.cpp index 39ee07767..1a957345a 100644 --- a/src/gui/debugwindow.cpp +++ b/src/gui/debugwindow.cpp @@ -412,16 +412,8 @@ NetDebugTab::NetDebugTab(const Widget2 *const widget) : void NetDebugTab::logic() { - if (player_node && player_node->getPingTime() != 0) - { - mPingLabel->setCaption(strprintf(_("Ping: %s ms"), - toString(static_cast(player_node->getPingTime())).c_str())); - } - else - { - mPingLabel->setCaption(strprintf(_("Ping: %s ms"), "?")); - } - + mPingLabel->setCaption(strprintf(_("Ping: %s ms"), + player_node->getPingTime().c_str())); mInPackets1Label->setCaption(strprintf(_("In: %d bytes/s"), PacketCounters::getInBytes())); mOutPackets1Label->setCaption(strprintf(_("Out: %d bytes/s"), -- cgit v1.2.3-60-g2f50