Fixed GainAbilityAttachedEffect that it can't apply some effects after enchantment dies (from gitter);

This commit is contained in:
Oleg Agafonov 2019-01-04 23:57:28 +04:00
parent f6585ef734
commit d81d253395

View file

@ -70,7 +70,7 @@ public class GainAbilityAttachedEffect extends ContinuousEffectImpl {
public void init(Ability source, Game game) {
super.init(source, game);
if (affectedObjectsSet) {
Permanent equipment = game.getPermanent(source.getSourceId());
Permanent equipment = game.getPermanentOrLKIBattlefield(source.getSourceId());
if (equipment != null && equipment.getAttachedTo() != null) {
this.setTargetPointer(new FixedTarget(equipment.getAttachedTo(), game.getState().getZoneChangeCounter(equipment.getAttachedTo())));
}
@ -107,7 +107,7 @@ public class GainAbilityAttachedEffect extends ContinuousEffectImpl {
} else {
sb.append("gains ");
}
sb.append(ability.getRule());
sb.append('"' + ability.getRule("this creature") + '"');
if (!duration.toString().isEmpty()) {
sb.append(' ').append(duration.toString());
}