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,9 +556,11 @@ public class PlayArea extends CardPanelContainer implements CardPanelMouseListen
|
|||||||
}
|
}
|
||||||
//if panel can't do anything with card selection, try selecting previous panel in stack
|
//if panel can't do anything with card selection, try selecting previous panel in stack
|
||||||
if (stack != null) {
|
if (stack != null) {
|
||||||
int index = stack.indexOf(panel);
|
for (int i = stack.indexOf(panel) + 1; i < stack.size(); i++) { //looping forward since panels stored in reverse order
|
||||||
if (index < stack.size() - 1 && selectCard(stack.get(index + 1), triggerEvent, selectOtherCardsInStack)) {
|
CardPanel p = stack.get(i);
|
||||||
return true;
|
if (p.getStack() == stack && selectCard(stack.get(i), triggerEvent, selectOtherCardsInStack)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//as a last resort try to select attached panels not in stack
|
//as a last resort try to select attached panels not in stack
|
||||||
|
|||||||
Reference in New Issue
Block a user