mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
- Prevent potential NPE
This commit is contained in:
@@ -123,7 +123,7 @@ public class AiAttackController {
|
||||
if (sa.getApi() == ApiType.Animate) {
|
||||
if (ComputerUtilCost.canPayCost(sa, defender)
|
||||
&& sa.getRestrictions().checkOtherRestrictions(c, sa, defender)) {
|
||||
Card animatedCopy = CardFactory.getCard(c.getPaperCard(), defender);
|
||||
Card animatedCopy = CardFactory.copyCard(c, true);
|
||||
AnimateAi.becomeAnimated(animatedCopy, sa);
|
||||
defenders.add(animatedCopy);
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ public class AnimateAi extends SpellAbilityAi {
|
||||
list = CardLists.filter(list, CardPredicates.canBeSacrificedBy(topStack));
|
||||
ComputerUtilCard.sortByEvaluateCreature(list);
|
||||
if (!list.isEmpty() && list.size() == nToSac && ComputerUtilCost.canPayCost(sa, aiPlayer)) {
|
||||
Card animatedCopy = CardFactory.getCard(source.getPaperCard(), aiPlayer);
|
||||
Card animatedCopy = CardFactory.copyCard(source, true);
|
||||
becomeAnimated(animatedCopy, sa);
|
||||
list.add(animatedCopy);
|
||||
list = CardLists.getValidCards(list, valid.split(","), aiPlayer.getOpponent(), topStack.getHostCard());
|
||||
|
||||
Reference in New Issue
Block a user