mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Simplification fixes
Return statement fixes
This commit is contained in:
parent
ac6b477aa2
commit
97a8380d07
@ -117,9 +117,9 @@ protected:
|
||||
|
||||
TBonusListPtr levelImmunities = target->getBonuses(Selector::type(Bonus::LEVEL_SPELL_IMMUNITY).And(Selector::info(1)), cachingStr.str());
|
||||
|
||||
return !(levelImmunities->size() > 0
|
||||
&& levelImmunities->totalValue() >= m->getSpellLevel()
|
||||
&& m->getSpellLevel() > 0);
|
||||
return levelImmunities->size() == 0 ||
|
||||
levelImmunities->totalValue() < m->getSpellLevel() ||
|
||||
m->getSpellLevel() <= 0;
|
||||
}
|
||||
};
|
||||
|
||||
@ -191,9 +191,9 @@ protected:
|
||||
bool check(const Mechanics * m, const battle::Unit * target) const override
|
||||
{
|
||||
TBonusListPtr levelImmunities = target->getBonuses(Selector::type(Bonus::LEVEL_SPELL_IMMUNITY));
|
||||
return !(levelImmunities->size() > 0 &&
|
||||
levelImmunities->totalValue() >= m->getSpellLevel() &&
|
||||
m->getSpellLevel() > 0);
|
||||
return levelImmunities->size() == 0 ||
|
||||
levelImmunities->totalValue() < m->getSpellLevel() ||
|
||||
m->getSpellLevel() <= 0;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -102,7 +102,7 @@ bool Dispel::mainSelector(const Bonus * bonus)
|
||||
if(sourceSpell->id == SpellID::CLONE)
|
||||
return false;
|
||||
//stack may have inherited effects
|
||||
return !sourceSpell->isAdventureSpell();
|
||||
return sourceSpell->isCombatSpell();
|
||||
}
|
||||
//not spell effect
|
||||
return false;
|
||||
|
@ -111,7 +111,7 @@ bool Sacrifice::applicable(Problem & problem, const Mechanics * m, const EffectT
|
||||
if(!victim)
|
||||
return false;
|
||||
|
||||
return !(!victim->alive() || !getStackFilter(m, false, victim) || !isReceptive(m, victim));
|
||||
return victim->alive() && getStackFilter(m, false, victim) && isReceptive(m, victim);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user