diff --git a/lib/CHeroHandler.cpp b/lib/CHeroHandler.cpp index 24d1b1a7c..e4a3de8da 100644 --- a/lib/CHeroHandler.cpp +++ b/lib/CHeroHandler.cpp @@ -492,9 +492,9 @@ std::vector> SpecialtyInfoToBonuses(const SSpecialtyInfo //propagate for regular upgrades of base creature for(auto cre_id : creatures[spec.subtype]->upgrades) { - bonus = std::make_shared(*bonus); - bonus->subtype = cre_id; - result.push_back(bonus); + std::shared_ptr upgradeUpgradedVersion = std::make_shared(*bonus); + upgradeUpgradedVersion->subtype = cre_id; + result.push_back(upgradeUpgradedVersion); } } break; @@ -613,10 +613,10 @@ void CHeroHandler::loadHeroSpecialty(CHero * hero, const JsonNode & node) for(const JsonNode &specialty : specialtiesNode.Vector()) { SSpecialtyInfo spec; - spec.type = specialty["type"].Float(); - spec.val = specialty["val"].Float(); - spec.subtype = specialty["subtype"].Float(); - spec.additionalinfo = specialty["info"].Float(); + spec.type = specialty["type"].Integer(); + spec.val = specialty["val"].Integer(); + spec.subtype = specialty["subtype"].Integer(); + spec.additionalinfo = specialty["info"].Integer(); //we convert after loading completes, to have all identifiers for json logging hero->specDeprecated.push_back(spec); } diff --git a/lib/HeroBonus.h b/lib/HeroBonus.h index 9c40267d4..e2070ef21 100644 --- a/lib/HeroBonus.h +++ b/lib/HeroBonus.h @@ -1034,7 +1034,7 @@ public: virtual std::string toString() const; virtual JsonNode toJsonNode() const = 0; - template void serialize(Handler &h, const int version) + template void serialize(Handler & h, const int version) { } }; @@ -1048,7 +1048,7 @@ public: ScalingUpdater(); ScalingUpdater(int valPer20, int stepSize = 1); - template void serialize(Handler &h, const int version) + template void serialize(Handler & h, const int version) { h & static_cast(*this); h & valPer20; diff --git a/lib/JsonNode.cpp b/lib/JsonNode.cpp index 326e5df04..de0d70880 100644 --- a/lib/JsonNode.cpp +++ b/lib/JsonNode.cpp @@ -648,7 +648,7 @@ bool JsonUtils::parseBonus(const JsonNode &ability, Bonus *b) b->propagator = parseByMap(bonusPropagatorMap, value, "propagator type "); value = &ability["updater"]; - if (!value->isNull()) + if(!value->isNull()) { const JsonNode & updaterJson = *value; if(updaterJson["type"].String() == "GROWS_WITH_LEVEL") diff --git a/lib/mapObjects/CGHeroInstance.cpp b/lib/mapObjects/CGHeroInstance.cpp index e64f8d0ff..753c17700 100644 --- a/lib/mapObjects/CGHeroInstance.cpp +++ b/lib/mapObjects/CGHeroInstance.cpp @@ -540,7 +540,7 @@ void CGHeroInstance::recreateSecondarySkillsBonuses() updateSkill(SecondarySkill(skill_info.first), level); } -void CGHeroInstance::recreateSpecialtyBonuses(std::vector & specialtyDeprecated) +void CGHeroInstance::recreateSpecialtyBonuses(std::vector & specialtyDeprecated) { auto HeroSpecialToSpecialtyBonus = [](HeroSpecial & hs) -> SSpecialtyBonus {