mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-06 09:09:40 +02:00
Deprecating enum constants
This commit is contained in:
@@ -297,6 +297,12 @@ int RewardEvaluator::getGoldCost(const CGObjectInstance * target, const CGHeroIn
|
||||
{
|
||||
if(!target)
|
||||
return 0;
|
||||
|
||||
if(auto * m = dynamic_cast<const IMarket *>(target))
|
||||
{
|
||||
if(m->allowsTrade(EMarketMode::RESOURCE_SKILL))
|
||||
return 2000;
|
||||
}
|
||||
|
||||
switch(target->ID)
|
||||
{
|
||||
@@ -305,8 +311,6 @@ int RewardEvaluator::getGoldCost(const CGObjectInstance * target, const CGHeroIn
|
||||
case Obj::SCHOOL_OF_MAGIC:
|
||||
case Obj::SCHOOL_OF_WAR:
|
||||
return 1000;
|
||||
case Obj::UNIVERSITY:
|
||||
return 2000;
|
||||
case Obj::CREATURE_GENERATOR1:
|
||||
case Obj::CREATURE_GENERATOR2:
|
||||
case Obj::CREATURE_GENERATOR3:
|
||||
|
||||
@@ -131,13 +131,16 @@ TSubgoal CollectRes::whatToDoToTrade()
|
||||
|
||||
std::vector<const CGObjectInstance *> visObjs;
|
||||
ai->retrieveVisitableObjs(visObjs, true);
|
||||
for (const CGObjectInstance * obj : visObjs)
|
||||
for(const CGObjectInstance * obj : visObjs)
|
||||
{
|
||||
if (const IMarket * m = IMarket::castFrom(obj, false))
|
||||
if(const IMarket * m = IMarket::castFrom(obj, false); m->allowsTrade(EMarketMode::RESOURCE_RESOURCE))
|
||||
{
|
||||
if (obj->ID == Obj::TOWN && obj->tempOwner == ai->playerID && m->allowsTrade(EMarketMode::RESOURCE_RESOURCE))
|
||||
markets.push_back(m);
|
||||
else if (obj->ID == Obj::TRADING_POST)
|
||||
if(obj->ID == Obj::TOWN)
|
||||
{
|
||||
if(obj->tempOwner == ai->playerID)
|
||||
markets.push_back(m);
|
||||
}
|
||||
else
|
||||
markets.push_back(m);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user