|
|
@@ -264,6 +264,7 @@ void BattleActionsController::reorderPossibleActionsPriority(const CStack * stac
|
|
|
case PossiblePlayerBattleAction::NO_LOCATION:
|
|
|
case PossiblePlayerBattleAction::FREE_LOCATION:
|
|
|
case PossiblePlayerBattleAction::OBSTACLE:
|
|
|
+ case PossiblePlayerBattleAction::SACRIFICE:
|
|
|
if(!stack->hasBonusOfType(BonusType::NO_SPELLCAST_BY_DEFAULT) && targetStack != nullptr)
|
|
|
{
|
|
|
PlayerColor stackOwner = owner.getBattle()->battleGetOwner(targetStack);
|
|
|
@@ -698,7 +699,14 @@ bool BattleActionsController::actionIsLegal(PossiblePlayerBattleAction action, c
|
|
|
return selectedStack && isCastingPossibleHere(action.spell().toSpell(), selectedStack, targetHex);
|
|
|
|
|
|
case PossiblePlayerBattleAction::SACRIFICE: //choose our living stack to sacrifice
|
|
|
- return targetStack && targetStack != selectedStack && targetStackOwned && targetStack->alive();
|
|
|
+ {
|
|
|
+ if(!targetStack)
|
|
|
+ return false;
|
|
|
+
|
|
|
+ auto unit = targetStack->acquire();
|
|
|
+ return targetStack != selectedStack && targetStackOwned && targetStack->alive()
|
|
|
+ && unit->isLiving() && !unit->hasBonusOfType(BonusType::MECHANICAL);
|
|
|
+ }
|
|
|
|
|
|
case PossiblePlayerBattleAction::OBSTACLE:
|
|
|
case PossiblePlayerBattleAction::FREE_LOCATION:
|