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

Fixed empty Black Market on game start

This commit is contained in:
Ivan Savenko 2023-04-19 23:11:17 +03:00
parent 01af231084
commit 5a5aced67e
2 changed files with 4 additions and 3 deletions

View File

@ -2,6 +2,7 @@
### GENERAL:
* Fixed movement cost penalty from terrain
* Fixed empty Black Market on game start
* Fixed blocked progress in Launcher on language detection failure
* Launcher will now correctly handle selection of Data directory in H3 install

View File

@ -279,10 +279,10 @@ void CGBlackMarket::newTurn(CRandomGenerator & rand) const
{
int resetPeriod = VLC->settings()->getInteger(EGameSettings::MARKETS_BLACK_MARKET_RESTOCK_PERIOD);
if(resetPeriod == 0) //check if feature changing OH3 behavior is enabled
return;
bool isFirstDay = cb->getDate(Date::DAY) == 1;
bool regularResetTriggered = resetPeriod != 0 && ((cb->getDate(Date::DAY)-1) % resetPeriod) != 0;
if (((cb->getDate(Date::DAY)-1) % resetPeriod) != 0)
if (!isFirstDay && !regularResetTriggered)
return;
SetAvailableArtifacts saa;