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

removed CHeroInstance::specialty

This commit is contained in:
Henning Koehler 2017-09-11 13:29:11 +12:00
parent 2703b035a6
commit 5d3f6c3b91
2 changed files with 4 additions and 9 deletions

View File

@ -496,8 +496,6 @@ void CGHeroInstance::SecondarySkillsInfo::resetWisdomCounter()
void CGHeroInstance::initObj(CRandomGenerator & rand)
{
blockVisit = true;
specialty.setNodeType(CBonusSystemNode::SPECIALTY);
attachTo(&specialty); //do we ever need to detach it?
if(!type)
initHero(rand); //TODO: set up everything for prison before specialties are configured
@ -515,14 +513,14 @@ void CGHeroInstance::initObj(CRandomGenerator & rand)
//copy active (probably growing) bonuses from hero prototype to hero object
for(std::shared_ptr<Bonus> b : type->specialty)
specialty.addNewBonus(b);
addNewBonus(b);
//dito for old-style bonuses -> compatibility for old savegames
for(SSpecialtyBonus & sb : type->specialtyDeprecated)
for(std::shared_ptr<Bonus> b : sb.bonuses)
specialty.addNewBonus(b);
addNewBonus(b);
for(SSpecialtyInfo & spec : type->specDeprecated)
for(std::shared_ptr<Bonus> b : SpecialtyInfoToBonuses(spec, type->ID.getNum()))
specialty.addNewBonus(b);
addNewBonus(b);
//initialize bonuses
recreateSecondarySkillsBonuses();
@ -988,7 +986,6 @@ int CGHeroInstance::maxSpellLevel() const
void CGHeroInstance::deserializationFix()
{
artDeserializationFix(this);
attachTo(&specialty);
}
CBonusSystemNode * CGHeroInstance::whereShouldBeAttached(CGameState *gs)

View File

@ -297,9 +297,7 @@ public:
h & visitedTown;
h & boat;
h & type;
if(version >= 778)
h & specialty;
else
if(version < 778)
h & specialtyDeprecated;
h & commander;
h & visitedObjects;