Skip to content

Commit

Permalink
Fix production limit console message throttling
Browse files Browse the repository at this point in the history
The first console message informing users about manufacturing limits,
familiar from its ending "Production Halted", was shown 40 seconds late
(the amount of MAX_UNIT_MESSAGE_PAUSE in human-readable time).

Refs ticket:4446
Refs #327
Fixes #329
  • Loading branch information
Forgon2100 authored and KJeff01 committed Apr 25, 2019
1 parent c165d8c commit 3bb244b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/structure.cpp
Expand Up @@ -2525,7 +2525,7 @@ static bool checkHaltOnMaxUnitsReached(STRUCTURE *psStructure, bool isMission)
break;
}

if (isLimit && player == selectedPlayer && lastMaxUnitMessage + MAX_UNIT_MESSAGE_PAUSE < gameTime)
if (isLimit && player == selectedPlayer && (lastMaxUnitMessage == 0 || lastMaxUnitMessage + MAX_UNIT_MESSAGE_PAUSE <= gameTime))
{
addConsoleMessage(limitMsg, DEFAULT_JUSTIFY, SYSTEM_MESSAGE);
lastMaxUnitMessage = gameTime;
Expand Down

0 comments on commit 3bb244b

Please sign in to comment.