mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-26 03:52:01 +02:00
CastleInterface: Exclude previous building upgrade in reqs
Hide CityHall from Capitol prerequisites in Capitol build window
This commit is contained in:
parent
237d3f2624
commit
bdee647525
@ -1364,7 +1364,7 @@ std::string CBuildWindow::getTextForState(int state)
|
||||
};
|
||||
|
||||
ret = CGI->generaltexth->allTexts[52];
|
||||
ret += "\n" + town->genBuildingRequirements(building->bid).toString(toStr);
|
||||
ret += "\n" + town->genBuildingRequirements(building->bid, false).toString(toStr);
|
||||
break;
|
||||
}
|
||||
case EBuildingState::MISSING_BASE:
|
||||
|
@ -1046,7 +1046,7 @@ bool CGTownInstance::hasBuilt(BuildingID buildingID) const
|
||||
return vstd::contains(builtBuildings, buildingID);
|
||||
}
|
||||
|
||||
CBuilding::TRequired CGTownInstance::genBuildingRequirements(BuildingID buildID) const
|
||||
CBuilding::TRequired CGTownInstance::genBuildingRequirements(BuildingID buildID, bool includeUpgrade) const
|
||||
{
|
||||
const CBuilding * building = town->buildings.at(buildID);
|
||||
|
||||
@ -1069,7 +1069,8 @@ CBuilding::TRequired CGTownInstance::genBuildingRequirements(BuildingID buildID)
|
||||
{
|
||||
const CBuilding * upgr = town->buildings.at(building->upgrade);
|
||||
|
||||
requirements.expressions.push_back(upgr->bid);
|
||||
if (includeUpgrade)
|
||||
requirements.expressions.push_back(upgr->bid);
|
||||
requirements.expressions.push_back(upgr->requirements.morph(dependTest));
|
||||
}
|
||||
requirements.expressions.push_back(building->requirements.morph(dependTest));
|
||||
|
@ -233,7 +233,7 @@ public:
|
||||
bool armedGarrison() const; //true if town has creatures in garrison or garrisoned hero
|
||||
int getTownLevel() const;
|
||||
|
||||
CBuilding::TRequired genBuildingRequirements(BuildingID build) const;
|
||||
CBuilding::TRequired genBuildingRequirements(BuildingID build, bool includeUpgrade=true) const;
|
||||
|
||||
void removeCapitols (PlayerColor owner) const;
|
||||
void addHeroToStructureVisitors(const CGHeroInstance *h, si32 structureInstanceID) const; //hero must be visiting or garrisoned in town
|
||||
|
Loading…
x
Reference in New Issue
Block a user