Helm of the Host: Fix the return values for ability; use getPermanentOrLKIBattlefield to find the equipped creature

This commit is contained in:
Will Hall 2018-04-09 20:43:07 -07:00
parent 661089c590
commit 05e4389993

View file

@ -99,17 +99,16 @@ class HelmOfTheHostEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Permanent equipment = game.getPermanentOrLKIBattlefield(source.getSourceId());
if (equipment == null) {
return false;
return true;
}
Permanent creature = game.getPermanent(equipment.getAttachedTo());
Permanent creature = game.getPermanentOrLKIBattlefield(equipment.getAttachedTo());
if (creature == null) {
return false;
return true;
}
CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect(source.getControllerId(), null, true);
effect.setTargetPointer(new FixedTarget(creature, game));
effect.setIsntLegendary(true);
effect.apply(game, source);
return true;
return effect.apply(game, source);
}
}