1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-12-01 23:12:49 +02:00

- primaryResource and warMachine now use string ID

- fixed long delays on moving units in garrisons
- fixed bug on loading available spells from map
- removed unused bigImgs from Graphics
This commit is contained in:
Ivan Savenko
2012-12-11 12:12:46 +00:00
parent 16b72ee89b
commit e3231db1c9
11 changed files with 250 additions and 200 deletions

View File

@@ -396,9 +396,19 @@ void CTownHandler::loadClientData(CTown &town, const JsonNode & source)
void CTownHandler::loadTown(CTown &town, const JsonNode & source)
{
auto resIter = boost::find(GameConstants::RESOURCE_NAMES, source["primaryResource"].String());
if (resIter == boost::end(GameConstants::RESOURCE_NAMES))
town.primaryRes = 127; //Wood + Ore
else
town.primaryRes = resIter - boost::begin(GameConstants::RESOURCE_NAMES);
VLC->modh->identifiers.requestIdentifier(std::string("creature." + source["warMachine"].String()),
[&town](si32 creature)
{
town.warMachine = CArtHandler::convertMachineID(creature, true);
});
town.mageLevel = source["mageGuild"].Float();
town.primaryRes = source["primaryResource"].Float();
town.warMachine = source["warMachine"].Float();
town.names = source["names"].convertTo<std::vector<std::string> >();
// Horde building creature level