1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

Remove marketModes as member

marketModes are now generated in runtime and are not a member of
IMarket. Was not a bad change, but towns load buildings before town type
is randomized, leading to case where market modes are not actually known
when building is added to town (like random towns with market built)

Since altar requires CArtifactSet for work, IMarket will now always
contain it, but it will only be accessible if market supports altar
mode.
This commit is contained in:
Ivan Savenko
2024-08-27 13:44:30 +00:00
parent 2ffce4a7c2
commit 20d5b33ea6
12 changed files with 55 additions and 96 deletions

View File

@@ -243,7 +243,6 @@ CGMarket * MarketInstanceConstructor::createObject(IGameCallback * cb) const
void MarketInstanceConstructor::initializeObject(CGMarket * market) const
{
market->addMarketMode(marketModes);
market->marketEfficiency = marketEfficiency;
if(auto university = dynamic_cast<CGUniversity*>(market))
@@ -257,6 +256,11 @@ void MarketInstanceConstructor::initializeObject(CGMarket * market) const
}
}
const std::set<EMarketMode> & MarketInstanceConstructor::availableModes() const
{
return marketModes;
}
void MarketInstanceConstructor::randomizeObject(CGMarket * object, vstd::RNG & rng) const
{
JsonRandom randomizer(object->cb);