Another refinement to Chaos Warp.

This commit is contained in:
MitchelStein 2014-08-17 06:51:36 -07:00
parent ce5d03446f
commit bef951d522

View file

@ -99,9 +99,10 @@ class ChaosWarpShuffleIntoLibraryEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source));
if (permanent != null) { Player owner = game.getPlayer(permanent.getOwnerId());
if (game.getPlayer(permanent.getOwnerId()).moveCardToLibraryWithInfo(permanent, source.getSourceID(), game, null, true, true)) { if (permanent != null && owner != null) {
game.getPlayer(permanent.getOwnerId()).shuffleLibrary(game); if (owner.moveCardToLibrary(permanent, source.getSourceID(), game, Zone.Battlefield, true, true) {
owner.shuffleLibrary(game);
return true; return true;
} }
} }