mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +00:00
Merge branch 'master' into 'master'
Fixed Vindictive Lich and SAView update for Charm in general (fixes related crashes and oddities). See merge request core-developers/forge!1236
This commit is contained in:
@@ -1432,11 +1432,19 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
|
||||
@Override
|
||||
public List<AbilitySub> chooseModeForAbility(final SpellAbility sa, final int min, final int num,
|
||||
boolean allowRepeat) {
|
||||
boolean trackerFrozen = game.getTracker().isFrozen();
|
||||
if (trackerFrozen) {
|
||||
// The view tracker needs to be unfrozen to update the SpellAbilityViews at this point, or it may crash
|
||||
game.getTracker().unfreeze();
|
||||
}
|
||||
final List<AbilitySub> possible = CharmEffect.makePossibleOptions(sa);
|
||||
HashMap<SpellAbilityView, AbilitySub> spellViewCache = new HashMap<>();
|
||||
for (AbilitySub spellAbility : possible) {
|
||||
spellViewCache.put(spellAbility.getView(), spellAbility);
|
||||
}
|
||||
if (trackerFrozen) {
|
||||
game.getTracker().freeze(); // refreeze if the tracker was frozen prior to this update
|
||||
}
|
||||
final List<SpellAbilityView> choices = new ArrayList<>(spellViewCache.keySet());
|
||||
final String modeTitle = TextUtil.concatNoSpace(sa.getActivatingPlayer().toString(), " activated ",
|
||||
sa.getHostCard().toString(), " - Choose a mode");
|
||||
|
||||
Reference in New Issue
Block a user