Skip to content
Permalink
Browse files

Merge pull request #142 from Necktrox/fix/disconnect-duration-text

Display seconds in disconnect message box if viable
  • Loading branch information
Necktrox committed May 26, 2017
2 parents c785369 + 4ed9c8e commit 5459fc5086ae644fea38831b35c60300e99bc6c1
Showing with 7 additions and 3 deletions.
  1. +7 −3 Client/mods/deathmatch/logic/CPacketHandler.cpp
@@ -581,13 +581,17 @@ void CPacketHandler::Packet_ServerDisconnected ( NetBitStreamInterface& bitStrea
int iHours = static_cast < int > ( Duration / 3600 );
Duration = Duration % 3600;
int iMins = static_cast < int > ( Duration / 60 );
Duration = Duration % 60;
int iSeconds = static_cast < int > ( Duration );

if ( iDays )
strReason += SString(_tn( "%d day", "%d days", iDays ),iDays) += iHours ? " " : "";
strReason += SString( _tn( "%d day", "%d days", iDays ), iDays ) += (iHours || iMins) ? " " : "";
if ( iHours )
strReason += SString(_tn( "%d hour", "%d hours", iHours ),iHours) += iMins ? " " : "";
strReason += SString( _tn( "%d hour", "%d hours", iHours ), iHours ) += iMins ? " " : "";
if ( iMins )
strReason += SString(_tn( "%d minute", "%d minutes", iMins ),iMins);
strReason += SString( _tn( "%d minute", "%d minutes", iMins ), iMins ) += iSeconds? " " : "";
if ( !iDays && !iHours && iSeconds )
strReason += SString( _tn( "%d second", "%d seconds", iSeconds ), iSeconds );
}

// Display the error

0 comments on commit 5459fc5

Please sign in to comment.
You can’t perform that action at this time.