瀏覽代碼

obstacle: correct logic as in OH3

Obstacle spells should not be cast if they are affected by native
terrain and enemy have at least one stack with native terrain
Konstantin 2 年之前
父節點
當前提交
edc9812559
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      lib/spells/effects/Obstacle.cpp

+ 3 - 0
lib/spells/effects/Obstacle.cpp

@@ -121,6 +121,9 @@ void Obstacle::adjustAffectedHexes(std::set<BattleHex> & hexes, const Mechanics
 
 bool Obstacle::applicable(Problem & problem, const Mechanics * m) const
 {
+	if(hidden && m->battle()->battleHasNativeStack(m->battle()->otherSide(m->casterSide)))
+		return m->adaptProblem(ESpellCastProblem::NO_APPROPRIATE_TARGET, problem);
+
 	return LocationEffect::applicable(problem, m);
 }