mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-19 21:10:12 +02:00
code review
This commit is contained in:
parent
a15cd05da3
commit
5c2523219c
@ -1063,7 +1063,7 @@ void CCastleBuildings::enterBank()
|
||||
std::vector<std::shared_ptr<CComponent>> components;
|
||||
if(town->bonusValue.second > 0)
|
||||
{
|
||||
components.push_back(std::make_shared<CComponent>(ComponentType::RESOURCE, GameResID(GameResID::GOLD), "-500/" + CGI->generaltexth->translate("core.genrltxt.64")));
|
||||
components.push_back(std::make_shared<CComponent>(ComponentType::RESOURCE_PER_DAY, GameResID(GameResID::GOLD), -500));
|
||||
LOCPLINT->showInfoDialog(CGI->generaltexth->translate("vcmi.townStructure.bank.payBack"), components);
|
||||
}
|
||||
else{
|
||||
|
@ -2473,12 +2473,7 @@ bool CGameHandler::triggerTownSpecialBuildingAction(ObjectInstanceID tid, Buildi
|
||||
{
|
||||
const CGTownInstance * t = getTown(tid);
|
||||
|
||||
bool hasBuilding = false;
|
||||
for (auto building : t->town->buildings)
|
||||
if(vstd::contains(t->builtBuildings, building.first) && building.second->subId == sid)
|
||||
hasBuilding = true;
|
||||
|
||||
if(!hasBuilding)
|
||||
if(t->town->getBuildingType(sid) == BuildingID::NONE)
|
||||
return false;
|
||||
|
||||
if(sid == BuildingSubID::EBuildingSubID::BANK)
|
||||
|
Loading…
x
Reference in New Issue
Block a user