Fix crash in tempShowCard

Fix crash that can occur from calling canPlay too early
This commit is contained in:
drdev
2014-10-06 05:20:48 +00:00
parent 6eef6ab9ad
commit 2cedade957
3 changed files with 4 additions and 6 deletions

View File

@@ -247,6 +247,7 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit
if (subAbility != null) {
subAbility.setActivatingPlayer(player);
}
view.updateCanPlay(this);
}
public Player getTargetingPlayer() {

View File

@@ -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);
}

View File

@@ -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);