1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Fix reset of rewardable objects with reset period of 1 day

This commit is contained in:
Ivan Savenko 2023-01-27 00:59:10 +02:00
parent 7bbaae75a2
commit d82822d37a

View File

@ -538,7 +538,7 @@ void CRewardableObject::triggerReset() const
void CRewardableObject::newTurn(CRandomGenerator & rand) const
{
if (resetParameters.period != 0 && cb->getDate(Date::DAY) > 1 && (cb->getDate(Date::DAY) % resetParameters.period) == 1)
if (resetParameters.period != 0 && cb->getDate(Date::DAY) > 1 && ((cb->getDate(Date::DAY)-1) % resetParameters.period) == 0)
triggerReset();
}