From 5a5aced67e8a1eb3ad5d356a705eaf0313286e84 Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Wed, 19 Apr 2023 23:11:17 +0300 Subject: [PATCH] Fixed empty Black Market on game start --- ChangeLog.md | 1 + lib/mapObjects/CGMarket.cpp | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index ea15567f8..651dc3df9 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -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 diff --git a/lib/mapObjects/CGMarket.cpp b/lib/mapObjects/CGMarket.cpp index 762088784..71204e86c 100644 --- a/lib/mapObjects/CGMarket.cpp +++ b/lib/mapObjects/CGMarket.cpp @@ -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;