diff --git a/lib/HeroBonus.cpp b/lib/HeroBonus.cpp index 3830f3298..76fe6863f 100644 --- a/lib/HeroBonus.cpp +++ b/lib/HeroBonus.cpp @@ -369,8 +369,8 @@ JsonNode CAddInfo::toJsonNode() const } } -std::atomic CBonusSystemNode::treeChanged(1); -const bool CBonusSystemNode::cachingEnabled = true; +std::atomic CBonusSystemNode::treeChanged(1); +constexpr bool CBonusSystemNode::cachingEnabled = true; BonusList::BonusList(bool BelongsToTree) : belongsToTree(BelongsToTree) { @@ -1534,8 +1534,7 @@ void CBonusSystemNode::treeHasChanged() int64_t CBonusSystemNode::getTreeVersion() const { - int64_t ret = treeChanged; - return ret << 32; + return treeChanged; } std::string Bonus::Description(boost::optional customValue) const diff --git a/lib/HeroBonus.h b/lib/HeroBonus.h index ea3b93801..00a5b9b49 100644 --- a/lib/HeroBonus.h +++ b/lib/HeroBonus.h @@ -781,7 +781,7 @@ private: static const bool cachingEnabled; mutable BonusList cachedBonuses; mutable int64_t cachedLast; - static std::atomic treeChanged; + static std::atomic treeChanged; // Setting a value to cachingStr before getting any bonuses caches the result for later requests. // This string needs to be unique, that's why it has to be setted in the following manner: