- Fixed RearrangeTopOfLibraryEffect

This commit is contained in:
swordshine
2014-02-11 05:03:26 +00:00
parent 6468dcc712
commit fb2287b8c2

View File

@@ -99,6 +99,7 @@ public class RearrangeTopOfLibraryEffect extends SpellAbilityEffect {
* a boolean.
*/
private void rearrangeTopOfLibrary(final Card src, final Player player, final int numCards, final boolean mayshuffle, final SpellAbility sa) {
final Player activator = sa.getActivatingPlayer();
final PlayerZone lib = player.getZone(ZoneType.Library);
int maxCards = lib.size();
// If library is smaller than N, only show that many cards
@@ -112,12 +113,12 @@ public class RearrangeTopOfLibraryEffect extends SpellAbilityEffect {
topCards.add(lib.get(j));
}
List<Card> orderedCards = player.getController().orderMoveToZoneList(topCards, ZoneType.Library);
List<Card> orderedCards = activator.getController().orderMoveToZoneList(topCards, ZoneType.Library);
for (int i = maxCards - 1; i >= 0; i--) {
Card next = orderedCards.get(i);
player.getGame().getAction().moveToLibrary(next, 0);
}
if (mayshuffle && player.getController().confirmAction(sa, null, "Do you want to shuffle the library?")) {
if (mayshuffle && activator.getController().confirmAction(sa, null, "Do you want to shuffle the library?")) {
player.shuffle(sa);
}
}