浏览代码

hackfix for commander spells

AlexVinS 9 年之前
父节点
当前提交
5e0a9d7966
共有 2 个文件被更改,包括 6 次插入2 次删除
  1. 1 1
      lib/spells/BattleSpellMechanics.cpp
  2. 5 1
      lib/spells/CDefaultSpellMechanics.cpp

+ 1 - 1
lib/spells/BattleSpellMechanics.cpp

@@ -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)

+ 5 - 1
lib/spells/CDefaultSpellMechanics.cpp

@@ -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)
 	{