mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +00:00
Fix to ensure cards in stack not linked to stack aren't checked twice
This commit is contained in:
@@ -556,11 +556,13 @@ public class PlayArea extends CardPanelContainer implements CardPanelMouseListen
|
||||
}
|
||||
//if panel can't do anything with card selection, try selecting previous panel in stack
|
||||
if (stack != null) {
|
||||
int index = stack.indexOf(panel);
|
||||
if (index < stack.size() - 1 && selectCard(stack.get(index + 1), triggerEvent, selectOtherCardsInStack)) {
|
||||
for (int i = stack.indexOf(panel) + 1; i < stack.size(); i++) { //looping forward since panels stored in reverse order
|
||||
CardPanel p = stack.get(i);
|
||||
if (p.getStack() == stack && selectCard(stack.get(i), triggerEvent, selectOtherCardsInStack)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
//as a last resort try to select attached panels not in stack
|
||||
for (CardPanel p : panel.getAttachedPanels()) {
|
||||
if (p.getStack() != stack) { //ensure same panel not checked more than once
|
||||
|
||||
Reference in New Issue
Block a user