mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
Prevent crash when declaring attackers/blockers
This commit is contained in:
@@ -123,7 +123,7 @@ public class InputAttack extends InputSyncronizedBase {
|
||||
@Override
|
||||
protected final void onCardSelected(final Card card, final MouseEvent triggerEvent) {
|
||||
final List<Card> att = combat.getAttackers();
|
||||
if (triggerEvent.getButton() == 3 && att.contains(card) && !card.hasKeyword("CARDNAME attacks each turn if able.")
|
||||
if (triggerEvent != null && triggerEvent.getButton() == 3 && att.contains(card) && !card.hasKeyword("CARDNAME attacks each turn if able.")
|
||||
&& !card.hasStartOfKeyword("CARDNAME attacks specific player each combat if able")) {
|
||||
// TODO Is there no way to attacks each turn cards to attack Planeswalkers?
|
||||
combat.removeFromCombat(card);
|
||||
|
||||
@@ -99,7 +99,7 @@ public class InputBlock extends InputSyncronizedBase {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final void onCardSelected(final Card card, final MouseEvent triggerEvent) {
|
||||
if (triggerEvent.getButton() == 3 && card.getController() == defender) {
|
||||
if (triggerEvent != null && triggerEvent.getButton() == 3 && card.getController() == defender) {
|
||||
combat.removeFromCombat(card);
|
||||
GuiBase.getInterface().fireEvent(new UiEventBlockerAssigned(card, (Card)null));
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user