1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-21 21:17:49 +02:00

hackfix for commander spells

This commit is contained in:
AlexVinS 2016-09-10 22:41:50 +03:00
parent 4a9978c642
commit 5e0a9d7966
2 changed files with 6 additions and 2 deletions

@ -731,7 +731,7 @@ ESpellCastProblem::ESpellCastProblem SpecialRisingSpellMechanics::canBeCast(cons
{
const bool ownerMatches = !ctx.ti.smart || s->getOwner() == ctx.caster->getOwner();
return ownerMatches && s->isValidTarget(true) && s->coversPos(ctx.destination);
return ownerMatches && s->isValidTarget(!ctx.ti.onlyAlive) && s->coversPos(ctx.destination);
});
if(nullptr == stack)

@ -664,7 +664,11 @@ std::vector<const CStack *> DefaultSpellMechanics::calculateAffectedStacks(const
std::set<const CStack* > attackedCres;//std::set to exclude multiple occurrences of two hex creatures
const ui8 attackerSide = cb->playerToSide(ctx.caster->getOwner()) == 1;
const auto attackedHexes = rangeInHexes(ctx.destination, ctx.schoolLvl, attackerSide);
auto attackedHexes = rangeInHexes(ctx.destination, ctx.schoolLvl, attackerSide);
//hackfix for banned creature massive spells
if(!ctx.ti.massive && owner->getLevelInfo(ctx.schoolLvl).range == "X")
attackedHexes.push_back(ctx.destination);
auto mainFilter = [=](const CStack * s)
{