set the minimum of seconds remaining in map downloading popup to 1

This commit is contained in:
oy 2011-06-27 22:35:23 +02:00
parent b7ce39be94
commit e8938e3d80

View file

@ -1058,7 +1058,7 @@ int CMenus::Render()
// time left
const char *pTimeLeftString;
int TimeLeft = m_DownloadSpeed > 0.0f ? (Client()->MapDownloadTotalsize()-Client()->MapDownloadAmount())/m_DownloadSpeed : 0.0f;
int TimeLeft = max(1, m_DownloadSpeed > 0.0f ? static_cast<int>((Client()->MapDownloadTotalsize()-Client()->MapDownloadAmount())/m_DownloadSpeed) : 1);
if(TimeLeft >= 60)
{
TimeLeft /= 60;