diff --git a/src/main/java/forge/card/cardfactory/CardFactoryUtil.java b/src/main/java/forge/card/cardfactory/CardFactoryUtil.java index bbbb6d192c2..bebe3f07898 100644 --- a/src/main/java/forge/card/cardfactory/CardFactoryUtil.java +++ b/src/main/java/forge/card/cardfactory/CardFactoryUtil.java @@ -940,7 +940,7 @@ public class CardFactoryUtil { @Override public boolean canPlay() { - return PhaseHandler.canCastSorcery(sourceCard.getController()) && !AllZoneUtil.isCardInPlay(sourceCard); + return sourceCard.getSpellPermanent().canPlay(); } }; @@ -4510,12 +4510,19 @@ public class CardFactoryUtil { @Override public void execute() { Log.debug("HandSize", "Control changed: " + card.getController()); - Player oldController = card.getController(); - Player newController = oldController.getOpponent(); - - oldController.removeHandSizeOperation(Integer.parseInt(card.getSVar("HSStamp"))); - newController.addHandSizeOperation(new HandSizeOp(mode, amount, Integer.parseInt(card.getSVar("HSStamp")))); - newController.sortHandSizeOperations(); + if (card.getController().isHuman()) { + AllZone.getHumanPlayer().removeHandSizeOperation(Integer.parseInt(card.getSVar("HSStamp"))); + AllZone.getComputerPlayer().addHandSizeOperation( + new HandSizeOp(mode, amount, Integer.parseInt(card.getSVar("HSStamp")))); + + AllZone.getComputerPlayer().sortHandSizeOperations(); + } else if (card.getController().isComputer()) { + AllZone.getComputerPlayer().removeHandSizeOperation(Integer.parseInt(card.getSVar("HSStamp"))); + AllZone.getHumanPlayer().addHandSizeOperation( + new HandSizeOp(mode, amount, Integer.parseInt(card.getSVar("HSStamp")))); + + AllZone.getHumanPlayer().sortHandSizeOperations(); + } } };