diff --git a/lib/bonuses/Bonus.h b/lib/bonuses/Bonus.h index 2ed8225b5..b32bfde2c 100644 --- a/lib/bonuses/Bonus.h +++ b/lib/bonuses/Bonus.h @@ -70,7 +70,7 @@ struct DLL_LINKAGE Bonus : public std::enable_shared_from_this std::string stacking; // bonuses with the same stacking value don't stack (e.g. Angel/Archangel morale bonus) CAddInfo additionalInfo; - BonusLimitEffect effectRange = BonusLimitEffect::NO_LIMIT; //if not NO_LIMIT, bonus will be omitted by default + BonusLimitEffect effectRange = BonusLimitEffect::NO_LIMIT; TLimiterPtr limiter; TPropagatorPtr propagator; diff --git a/lib/bonuses/BonusList.cpp b/lib/bonuses/BonusList.cpp index 752335044..ee6b2b64e 100644 --- a/lib/bonuses/BonusList.cpp +++ b/lib/bonuses/BonusList.cpp @@ -190,9 +190,7 @@ void BonusList::getBonuses(BonusList & out, const CSelector &selector, const CSe out.reserve(bonuses.size()); for(const auto & b : bonuses) { - //add matching bonuses that matches limit predicate or have NO_LIMIT if no given predicate - auto noFightLimit = b->effectRange == BonusLimitEffect::NO_LIMIT; - if(selector(b.get()) && ((!limit && noFightLimit) || ((bool)limit && limit(b.get())))) + if(selector(b.get()) && (!limit || ((bool)limit && limit(b.get())))) out.push_back(b); } }