mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
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 aura = game.getPermanent(source.getFirstTarget());
|
||||||
Permanent creature = game.getPermanent(source.getTargets().get(1).getFirstTarget());
|
Permanent creature = game.getPermanent(source.getTargets().get(1).getFirstTarget());
|
||||||
if (aura != null && creature != null) {
|
if (aura != null && creature != null) {
|
||||||
aura.attachTo(creature.getId(), game);
|
Permanent oldCreature = game.getPermanent(aura.getAttachedTo());
|
||||||
creature.addAttachment(aura.getId(), game);
|
if (oldCreature == null || oldCreature.equals(creature)) {
|
||||||
return true;
|
return false;
|
||||||
|
}
|
||||||
|
if (oldCreature.removeAttachment(aura.getId(), game)) {
|
||||||
|
return creature.addAttachment(aura.getId(), game);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue