forked from External/mage
Fixed a bug of Aura Finesse not triggering UNATTACH event.
This commit is contained in:
parent
cae028cc78
commit
0bf9491aa1
1 changed files with 7 additions and 3 deletions
|
|
@ -102,9 +102,13 @@ class AuraFinesseEffect extends OneShotEffect<AuraFinesseEffect> {
|
|||
Permanent aura = game.getPermanent(source.getFirstTarget());
|
||||
Permanent creature = game.getPermanent(source.getTargets().get(1).getFirstTarget());
|
||||
if (aura != null && creature != null) {
|
||||
aura.attachTo(creature.getId(), game);
|
||||
creature.addAttachment(aura.getId(), game);
|
||||
return true;
|
||||
Permanent oldCreature = game.getPermanent(aura.getAttachedTo());
|
||||
if (oldCreature == null || oldCreature.equals(creature)) {
|
||||
return false;
|
||||
}
|
||||
if (oldCreature.removeAttachment(aura.getId(), game)) {
|
||||
return creature.addAttachment(aura.getId(), game);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue