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

- Commanders are now a part of faction config

- Support for external dwellings for new towns
This commit is contained in:
DjWarmonger
2012-12-19 16:35:58 +00:00
parent c0ce8712c1
commit 0e06ac15ad
17 changed files with 61 additions and 11 deletions

View File

@@ -9,6 +9,7 @@
#include "CArtHandler.h"
#include "CTownHandler.h"
#include "CHeroHandler.h"
#include "CObjectHandler.h"
/*
* CModHandler.h, part of VCMI engine
@@ -224,6 +225,21 @@ void CModHandler::reload()
VLC->dobjinfo->capitols[town.first] = new CGDefInfo(*townInfos[town.first]);
VLC->dobjinfo->capitols[town.first]->name = cientInfo.advMapCapitol;
for (int i = 0; i < town.second.dwellings.size(); ++i)
{
const CGDefInfo * baseInfo = VLC->dobjinfo->gobjs[Obj::CREATURE_GENERATOR1][i]; //get same blockmap as first dwelling of tier i
BOOST_FOREACH (auto cre, town.second.creatures[i]) //both unupgraded and upgraded get same dwelling
{
CGDefInfo * info = new CGDefInfo(*baseInfo);
info->subid = cre;
info->name = town.second.dwellings[i];
VLC->dobjinfo->gobjs[Obj::CREATURE_GENERATOR1][cre] = info;
VLC->objh->cregens[cre] = cre; //map of dwelling -> creature id
}
}
}
}
}