Bläddra i källkod

removed CHeroInstance::specialty

Henning Koehler 8 år sedan
förälder
incheckning
5d3f6c3b91
2 ändrade filer med 4 tillägg och 9 borttagningar
  1. 3 6
      lib/mapObjects/CGHeroInstance.cpp
  2. 1 3
      lib/mapObjects/CGHeroInstance.h

+ 3 - 6
lib/mapObjects/CGHeroInstance.cpp

@@ -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)

+ 1 - 3
lib/mapObjects/CGHeroInstance.h

@@ -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;