Fixed game errors for non started games (some cards uses dynamic hints with non-protected code)

This commit is contained in:
Oleg Agafonov 2023-06-09 06:48:59 +04:00
parent ec7befa511
commit 35b00c3da1
2 changed files with 28 additions and 20 deletions

View file

@ -275,6 +275,11 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
rules.addAll(info.values());
}
if (game == null || game.getPhase() == null) {
// dynamic hints for started game only
return rules;
}
// ability hints
List<String> abilityHints = new ArrayList<>();
if (HintUtils.ABILITY_HINTS_ENABLE) {
@ -290,7 +295,7 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
// restrict hints
List<String> restrictHints = new ArrayList<>();
if (game != null && HintUtils.RESTRICT_HINTS_ENABLE) {
if (HintUtils.RESTRICT_HINTS_ENABLE) {
// restrict
for (Map.Entry<RestrictionEffect, Set<Ability>> entry : game.getContinuousEffects().getApplicableRestrictionEffects(this, game).entrySet()) {
for (Ability ability : entry.getValue()) {