mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
Fix crash in tempShowCard
Fix crash that can occur from calling canPlay too early
This commit is contained in:
@@ -247,6 +247,7 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit
|
|||||||
if (subAbility != null) {
|
if (subAbility != null) {
|
||||||
subAbility.setActivatingPlayer(player);
|
subAbility.setActivatingPlayer(player);
|
||||||
}
|
}
|
||||||
|
view.updateCanPlay(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Player getTargetingPlayer() {
|
public Player getTargetingPlayer() {
|
||||||
|
|||||||
@@ -10,11 +10,6 @@ public class SpellAbilityView extends TrackableObject<SpellAbilityProp> {
|
|||||||
super(sa.getId(), SpellAbilityProp.class);
|
super(sa.getId(), SpellAbilityProp.class);
|
||||||
updateHostCard(sa);
|
updateHostCard(sa);
|
||||||
updateDescription(sa);
|
updateDescription(sa);
|
||||||
|
|
||||||
//only update remaining properties if within Game context
|
|
||||||
if (sa.getHostCard().getGame() == null) { return; }
|
|
||||||
|
|
||||||
updateCanPlay(sa);
|
|
||||||
updatePromptIfOnlyPossibleAbility(sa);
|
updatePromptIfOnlyPossibleAbility(sa);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -164,7 +164,9 @@ public class PlayerControllerHuman extends PlayerController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void tempShowCard(Card c) {
|
private void tempShowCard(Card c) {
|
||||||
CardView cv = MatchUtil.cards.get(c.getId());
|
if (c == null) { return; }
|
||||||
|
|
||||||
|
CardView cv = gameView.getCardView(c, false);
|
||||||
if (!cv.mayBeShown()) {
|
if (!cv.mayBeShown()) {
|
||||||
cv.setMayBeShown(true);
|
cv.setMayBeShown(true);
|
||||||
tempShownCards.add(c);
|
tempShownCards.add(c);
|
||||||
|
|||||||
Reference in New Issue
Block a user