1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

- Implementation of overrides for towns

- Converted dwellings.json into new format
- Implemented "mapObject" entry in town format
- Removed capital/fort/village fields from town in favor of overrides
This commit is contained in:
Ivan Savenko
2014-06-15 19:43:01 +03:00
parent 7cfd9a0903
commit 836c466f81
27 changed files with 340 additions and 288 deletions

View File

@ -157,15 +157,6 @@ static void readBankLevel(const JsonNode &level, BankConfig &bc)
CObjectHandler::CObjectHandler()
{
logGlobal->traceStream() << "\t\tReading cregens ";
const JsonNode config(ResourceID("config/dwellings.json"));
for(const JsonNode &dwelling : config["dwellings"].Vector())
{
cregens[dwelling["dwelling"].Float()] = CreatureID((si32)dwelling["creature"].Float());
}
logGlobal->traceStream() << "\t\tDone loading cregens!";
logGlobal->traceStream() << "\t\tReading resources prices ";
const JsonNode config2(ResourceID("config/resources.json"));
for(const JsonNode &price : config2["resources_prices"].Vector())
@ -342,10 +333,10 @@ void CGObjectInstance::setType(si32 ID, si32 subID)
this->ID = Obj(ID);
this->subID = subID;
this->appearance = VLC->objtypeh->getHandlerFor(ID, subID)->getTemplates(tile.terType).front();
//recalculate blockvis tiles - new appearance might have different blockmap than before
cb->gameState()->map->removeBlockVisTiles(this, true);
this->appearance = VLC->objtypeh->getHandlerFor(ID, subID)->getTemplates(tile.terType).at(0);
cb->gameState()->map->addBlockVisTiles(this);
}