mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
- Fixed castle.json (building structures)
This commit is contained in:
parent
6caac8e82b
commit
30b3081ac4
@ -155,7 +155,7 @@
|
||||
"shipyard": { "id" : 6 },
|
||||
"fort": { "id" : 7 },
|
||||
"citadel": { "id" : 8, "upgrades" : "fort" },
|
||||
"castle": { "id" : 9, "upgrades" : "castle" },
|
||||
"castle": { "id" : 9, "upgrades" : "citadel" },
|
||||
"villageHall": { "id" : 10, "mode" : "auto" },
|
||||
"townHall": { "id" : 11, "upgrades" : "villageHall", "requires" : [ "tavern" ] },
|
||||
"cityHall": { "id" : 12, "upgrades" : "townHall", "requires" : [ "allOf", [ "mageGuild1" ], [ "marketplace" ], [ "blacksmith" ] ] },
|
||||
|
@ -37,7 +37,9 @@ BuildingID CBuilding::getBase() const
|
||||
{
|
||||
const CBuilding * build = this;
|
||||
while (build->upgrade >= 0)
|
||||
{
|
||||
build = build->town->buildings.at(build->upgrade);
|
||||
}
|
||||
|
||||
return build->bid;
|
||||
}
|
||||
@ -313,6 +315,13 @@ void CTownHandler::loadBuilding(CTown &town, const std::string & stringID, const
|
||||
ret->upgrade = BuildingID(identifier);
|
||||
});
|
||||
}
|
||||
|
||||
// building id and upgrades can't be the same
|
||||
if(ret->upgrade == ret->bid)
|
||||
{
|
||||
throw std::runtime_error(boost::str(boost::format("Building with ID '%s' of town '%s' can't be an upgrade of the same building.") %
|
||||
stringID % town.faction->name));
|
||||
}
|
||||
}
|
||||
else
|
||||
ret->upgrade = BuildingID::NONE;
|
||||
|
Loading…
Reference in New Issue
Block a user