mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 18:58:00 +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) {
|
||||
subAbility.setActivatingPlayer(player);
|
||||
}
|
||||
view.updateCanPlay(this);
|
||||
}
|
||||
|
||||
public Player getTargetingPlayer() {
|
||||
|
||||
@@ -10,11 +10,6 @@ public class SpellAbilityView extends TrackableObject<SpellAbilityProp> {
|
||||
super(sa.getId(), SpellAbilityProp.class);
|
||||
updateHostCard(sa);
|
||||
updateDescription(sa);
|
||||
|
||||
//only update remaining properties if within Game context
|
||||
if (sa.getHostCard().getGame() == null) { return; }
|
||||
|
||||
updateCanPlay(sa);
|
||||
updatePromptIfOnlyPossibleAbility(sa);
|
||||
}
|
||||
|
||||
|
||||
@@ -164,7 +164,9 @@ public class PlayerControllerHuman extends PlayerController {
|
||||
}
|
||||
}
|
||||
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()) {
|
||||
cv.setMayBeShown(true);
|
||||
tempShownCards.add(c);
|
||||
|
||||
Reference in New Issue
Block a user