GUI: fixed bugs with some stacked tokens (closes #12246, related to #12242) (#12248)

This commit is contained in:
grimreap124 2024-05-19 04:56:01 +10:00 committed by GitHub
parent 4fabc4c70e
commit 61b7918fe6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -141,13 +141,11 @@ public class CardPluginImpl implements CardPlugin {
for (MageCard card : cards.values()) {
MagePermanent perm = (MagePermanent) card.getMainPanel(); // all cards must be MagePermanent on battlefield
if (!rowType.isType(perm)) {
if (!rowType.isType(perm) || perm.getOriginalPermanent().isAttachedToPermanent()) {
continue;
}
if ((!perm.isLand() && !perm.isToken())
|| perm.getOriginalPermanent().isAttachedToPermanent()
|| (perm.isCreature())) {
if ((!perm.isLand() && !perm.isToken()) || (perm.isCreature())) {
Stack newStack = new Stack();
newStack.add(perm);
workingRow.add(newStack);
@ -162,9 +160,11 @@ public class CardPluginImpl implements CardPlugin {
// use top layer panel
Stack stack = workingRow.get(i);
MagePermanent firstPanelPerm = stack.get(0);
// Check the names are equal and are creatures with the same summoning sickness
if (firstPanelPerm.getOriginal().getName().equals(perm.getOriginal().getName())
&& firstPanelPerm.getOriginalPermanent().hasSummoningSickness() == perm.getOriginalPermanent()
.hasSummoningSickness()) {
&& (!perm.isCreature() || firstPanelPerm.getOriginalPermanent().hasSummoningSickness() == perm
.getOriginalPermanent().hasSummoningSickness())) {
if (!empty(firstPanelPerm.getOriginalPermanent().getAttachments())) {
// Put this land to the left of lands with the same name and attachments.