Drana and Linvala - fixed game error on usage with same abilities from permanents (NPE error)

This commit is contained in:
Oleg Agafonov 2023-05-09 15:59:17 +04:00
parent 1dc5ee13a3
commit a18dcd9911
2 changed files with 4 additions and 1 deletions

View file

@ -124,7 +124,9 @@ class DranaAndLinvalaGainAbilitiesEffect extends ContinuousEffectImpl {
|| ability.getAbilityType() == AbilityType.MANA)
.collect(Collectors.toList())) {
Ability addedAbility = perm.addAbility(ability, source.getSourceId(), game);
addedAbility.getEffects().setValue("dranaLinvalaFlag", true);
if (addedAbility != null) {
addedAbility.getEffects().setValue("dranaLinvalaFlag", true);
}
}
return true;
}

View file

@ -211,6 +211,7 @@ public interface Permanent extends Card, Controllable {
* @param ability
* @param sourceId
* @param game
* @return can be null for exists abilities
*/
Ability addAbility(Ability ability, UUID sourceId, Game game);