1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00

Fix creature timer update

This commit is contained in:
nordsoft 2023-08-26 05:45:45 +04:00
parent 0bc2302f1f
commit 0bb352565a

View File

@ -156,7 +156,9 @@ void TurnTimerHandler::onBattleLoop(int waitTime)
if(tTimer.creatureTimer > 0)
{
tTimer.creatureTimer -= waitTime;
int frequency = (tTimer.creatureTimer > turnTimePropagateThreshold ? turnTimePropagateFrequency : turnTimePropagateFrequencyCrit);
int frequency = (tTimer.creatureTimer > turnTimePropagateThreshold
&& si->turnTimerInfo.creatureTimer - tTimer.creatureTimer > turnTimePropagateThreshold)
? turnTimePropagateFrequency : turnTimePropagateFrequencyCrit;
if(state.status == EPlayerStatus::INGAME //do not send message if player is not active already
&& tTimer.creatureTimer % frequency == 0)