Skip to content

Commit

Permalink
Merge pull request #142 from Necktrox/fix/disconnect-duration-text
Browse files Browse the repository at this point in the history
Display seconds in disconnect message box if viable
  • Loading branch information
Necktrox committed May 26, 2017
2 parents c785369 + 4ed9c8e commit 5459fc5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Client/mods/deathmatch/logic/CPacketHandler.cpp
Expand Up @@ -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
Expand Down

0 comments on commit 5459fc5

Please sign in to comment.