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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user