Michał W. Urbańczyk 13 年之前
父节点
当前提交
0b85cfaf78
共有 2 个文件被更改,包括 6 次插入3 次删除
  1. 4 1
      client/BattleInterface/CBattleInterface.cpp
  2. 2 2
      lib/CBattleCallback.cpp

+ 4 - 1
client/BattleInterface/CBattleInterface.cpp

@@ -2768,8 +2768,11 @@ void CBattleInterface::handleHex(BattleHex myNumber, int eventType)
 		}
 	};
 
-	const CStack * const shere = curInt->cb->battleGetStackByPos(myNumber, false);
 	const CStack * const sactive = activeStack;
+	//Get stack on the hex - first try to grab the alive one, if not found -> allow dead stacks.
+	const CStack *shere = curInt->cb->battleGetStackByPos(myNumber, true);
+	if(!shere)
+		shere = curInt->cb->battleGetStackByPos(myNumber, false);
 
 	if (!sactive)
 		return;

+ 2 - 2
lib/CBattleCallback.cpp

@@ -1716,8 +1716,8 @@ ESpellCastProblem::ESpellCastProblem CBattleInfoCallback::battleCanCastThisSpell
 
 
 	//get dead stack if we cast resurrection or animate dead
-	const CStack *deadStack = getStackIf([dest](const CStack *s) { return !s->alive() && s->position == dest; });
-	const CStack *aliveStack = getStackIf([dest](const CStack *s) { return s->alive() && s->position == dest;});
+	const CStack *deadStack = getStackIf([dest](const CStack *s) { return !s->alive() && s->coversPos(dest); });
+	const CStack *aliveStack = getStackIf([dest](const CStack *s) { return s->alive() && s->coversPos(dest);});
 
 
 	if(spell->isRisingSpell())