mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
discard, even with triggers, won't cause exceptions
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
package forge.control.input;
|
package forge.control.input;
|
||||||
|
|
||||||
import forge.Card;
|
import forge.Card;
|
||||||
|
import forge.FThreads;
|
||||||
import forge.Singletons;
|
import forge.Singletons;
|
||||||
import forge.game.GameState;
|
import forge.game.GameState;
|
||||||
import forge.game.player.Player;
|
import forge.game.player.Player;
|
||||||
@@ -74,12 +75,15 @@ public class InputCleanup extends InputBase {
|
|||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
@Override
|
@Override
|
||||||
public final void selectCard(final Card card) {
|
public final void selectCard(final Card card) {
|
||||||
Zone zone = Singletons.getModel().getGame().getZoneOf(card);
|
Zone zone = game.getZoneOf(card);
|
||||||
if (zone.is(ZoneType.Hand, Singletons.getControl().getPlayer())) {
|
if (!zone.is(ZoneType.Hand, Singletons.getControl().getPlayer()))
|
||||||
|
return;
|
||||||
|
|
||||||
|
FThreads.invokeInNewThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
card.getController().discard(card, null);
|
card.getController().discard(card, null);
|
||||||
if (Singletons.getModel().getGame().getStack().size() == 0) {
|
|
||||||
this.showMessage();
|
|
||||||
}
|
}
|
||||||
|
}, true);
|
||||||
}
|
}
|
||||||
} // selectCard()
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user