1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

- Implemented "mapObject" entry for hero classes

- Updated schemas
- Some bugfixing
This commit is contained in:
Ivan Savenko
2014-06-16 19:27:26 +03:00
parent 89b89ff85d
commit 09d595e385
15 changed files with 125 additions and 164 deletions

View File

@@ -232,9 +232,9 @@ void CGHeroInstance::initHero(HeroTypeID SUBID)
void CGHeroInstance::setType(si32 ID, si32 subID)
{
assert(ID == Obj::HERO); // just in case
CGObjectInstance::setType(ID, subID);
type = VLC->heroh->heroes[subID];
portrait = type->imageIndex;
CGObjectInstance::setType(ID, type->heroClass->id);
randomizeArmy(type->heroClass->faction);
}
@@ -472,6 +472,10 @@ void CGHeroInstance::initObj()
skillsInfo.resetMagicSchoolCounter();
skillsInfo.resetWisdomCounter();
auto customApp = VLC->objtypeh->getHandlerFor(ID, type->heroClass->id)->getOverride(cb->gameState()->getTile(visitablePos())->terType, this);
if (customApp)
appearance = customApp.get();
for(const auto &spec : type->spec) //TODO: unfity with bonus system
{
auto bonus = new Bonus();