mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-23 00:28:08 +02:00
code review
This commit is contained in:
@ -1063,7 +1063,7 @@ void CCastleBuildings::enterBank()
|
|||||||
std::vector<std::shared_ptr<CComponent>> components;
|
std::vector<std::shared_ptr<CComponent>> components;
|
||||||
if(town->bonusValue.second > 0)
|
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);
|
LOCPLINT->showInfoDialog(CGI->generaltexth->translate("vcmi.townStructure.bank.payBack"), components);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
@ -2473,12 +2473,7 @@ bool CGameHandler::triggerTownSpecialBuildingAction(ObjectInstanceID tid, Buildi
|
|||||||
{
|
{
|
||||||
const CGTownInstance * t = getTown(tid);
|
const CGTownInstance * t = getTown(tid);
|
||||||
|
|
||||||
bool hasBuilding = false;
|
if(t->town->getBuildingType(sid) == BuildingID::NONE)
|
||||||
for (auto building : t->town->buildings)
|
|
||||||
if(vstd::contains(t->builtBuildings, building.first) && building.second->subId == sid)
|
|
||||||
hasBuilding = true;
|
|
||||||
|
|
||||||
if(!hasBuilding)
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if(sid == BuildingSubID::EBuildingSubID::BANK)
|
if(sid == BuildingSubID::EBuildingSubID::BANK)
|
||||||
|
Reference in New Issue
Block a user