Merge origin/master

This commit is contained in:
LevelX2 2014-08-27 17:10:40 +02:00
commit a2bbfbd55b

View file

@ -6,6 +6,7 @@ import mage.constants.Rarity;
import mage.interfaces.plugin.CardPlugin;
import mage.utils.CardUtil;
import mage.view.CardView;
import mage.view.CounterView;
import mage.view.PermanentView;
import net.xeoh.plugins.base.annotations.PluginImplementation;
import net.xeoh.plugins.base.annotations.events.Init;
@ -134,11 +135,24 @@ public class CardPluginImpl implements CardPlugin {
insertIndex = i;
break;
}
List<CounterView> counters = firstPanel.getOriginalPermanent().getCounters();
if (counters != null && counters.size() > 0) {
// don't put to first panel if it has counters
insertIndex = i;
break;
}
if (!empty(permanent.getOriginalPermanent().getAttachments()) || stack.size() == landStackMax) {
// If this land has attachments or the stack is full, put it to the right.
insertIndex = i + 1;
continue;
}
counters = permanent.getOriginalPermanent().getCounters();
if (counters != null && counters.size() > 0) {
// if a land has counter, put it to the right
insertIndex = i + 1;
continue;
}
// Add to stack.
stack.add(0, permanent);
continue outerLoop;