mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-29 23:07:48 +02:00
Remove strange & unused double-selector logic
This commit is contained in:
@@ -172,11 +172,11 @@ std::shared_ptr<const Bonus> BonusList::getFirst(const CSelector &selector) cons
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void BonusList::getBonuses(BonusList & out, const CSelector &selector, const CSelector &limit) const
|
||||
void BonusList::getBonuses(BonusList & out, const CSelector &selector) const
|
||||
{
|
||||
for(const auto & b : bonuses)
|
||||
{
|
||||
if(selector(b.get()) && (!limit || ((bool)limit && limit(b.get()))))
|
||||
if(selector(b.get()))
|
||||
out.push_back(b);
|
||||
}
|
||||
}
|
||||
@@ -190,8 +190,7 @@ void BonusList::getAllBonuses(BonusList &out) const
|
||||
int BonusList::valOfBonuses(const CSelector &select, int baseValue) const
|
||||
{
|
||||
BonusList ret;
|
||||
CSelector limit = nullptr;
|
||||
getBonuses(ret, select, limit);
|
||||
getBonuses(ret, select);
|
||||
return ret.totalValue(baseValue);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user