mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
basic support for bank
This commit is contained in:
@@ -2469,6 +2469,29 @@ bool CGameHandler::buildStructure(ObjectInstanceID tid, BuildingID requestedID,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CGameHandler::triggerTownSpecialBuildingAction(ObjectInstanceID tid, BuildingSubID::EBuildingSubID sid)
|
||||
{
|
||||
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)
|
||||
return false;
|
||||
|
||||
|
||||
if(sid == BuildingSubID::EBuildingSubID::BANK)
|
||||
{
|
||||
TResources res;
|
||||
res[EGameResID::GOLD] = 2500;
|
||||
giveResources(t->getOwner(), res);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CGameHandler::razeStructure (ObjectInstanceID tid, BuildingID bid)
|
||||
{
|
||||
///incomplete, simply erases target building
|
||||
|
||||
Reference in New Issue
Block a user