1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-01 00:45:26 +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

@ -762,7 +762,7 @@ void CGHeroInstance::initHero()
if (VLC->modh->modules.COMMANDERS)
{
commander = new CCommanderInstance (VLC->creh->factionCommanders[type->heroClass->faction]);
commander = new CCommanderInstance (VLC->townh->factions[type->heroClass->faction].commander);
commander->setArmyObj (castToArmyObj()); //TODO: separate function for setting commanders
}
@ -1531,7 +1531,14 @@ void CGDwelling::initObj()
creatures.resize(1);
creatures[0].second.push_back(crid);
hoverName = VLC->generaltexth->creGens[subID];
if (subID >= VLC->generaltexth->creGens.size()) //very messy workaround
{
int faction = VLC->creh->creatures[subID]->faction;
assert (VLC->townh->towns[faction].dwellingNames.size());
hoverName = VLC->townh->towns[faction].dwellingNames[VLC->creh->creatures[subID]->level - 1];
}
else
hoverName = VLC->generaltexth->creGens[subID];
if(crs->level > 4)
putStack(0, new CStackInstance(crs, (crs->growth) * 3));
if (getOwner() != GameConstants::NEUTRAL_PLAYER)