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

Remove Capitol-related code, it's redundant now.

This commit is contained in:
DJWarmonger 2018-08-07 06:41:44 +02:00
parent a827c083d8
commit 6fd403d7cf

View File

@ -288,18 +288,6 @@ TResources ResourceManager::reservedResources() const
TResources ResourceManager::freeResources() const
{
TResources myRes = cb->getResourceAmount();
auto towns = cb->getTownsInfo();
if (towns.size()) //we don't save for Capitol if there are no towns
{
if (std::none_of(towns.begin(), towns.end(), [](const CGTownInstance * x) -> bool
{
return x->builtBuildings.find(BuildingID::CAPITOL) != x->builtBuildings.end();
}))
{
myRes[Res::GOLD] -= GOLD_RESERVE;
//what if capitol is blocked from building in all possessed towns (set in map editor)?
}
}
myRes -= reservedResources(); //substract the value of reserved goals
for (auto & val : myRes)