forked from External/mage
[C21] Fixed Fractal Harness adding too many counters on attack (fixes #8377)
This commit is contained in:
parent
f48eb4a179
commit
e8db40bb8d
2 changed files with 4 additions and 5 deletions
|
|
@ -108,14 +108,11 @@ class FractalHarnessDoubleEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = (Permanent) getValue("attachedPermanent");
|
||||
Permanent permanent = game.getPermanent((UUID) getValue("sourceId"));
|
||||
if (permanent == null) {
|
||||
return false;
|
||||
}
|
||||
// BUG : changed this to a integer due to the trigger firing twice
|
||||
final int addedCounters = permanent.getCounters(game).getCount(CounterType.P1P1);
|
||||
// BUG : this oneShotEffect is being run twice for some reason, so the number of counters is four times as many
|
||||
return permanent.addCounters(CounterType.P1P1.createInstance(addedCounters),
|
||||
return permanent.addCounters(CounterType.P1P1.createInstance(permanent.getCounters(game).getCount(CounterType.P1P1)),
|
||||
source.getControllerId(), source, game);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,6 +54,8 @@ public class AttacksAttachedTriggeredAbility extends TriggeredAbilityImpl {
|
|||
if (equipment != null && equipment.getAttachedTo() != null
|
||||
&& event.getSourceId().equals(equipment.getAttachedTo())) {
|
||||
getEffects().setValue("sourceId", event.getSourceId());
|
||||
// TODO: Passing a permanent object like this can cause bugs. May need refactoring to use UUID instead.
|
||||
// See https://github.com/magefree/mage/issues/8377
|
||||
getEffects().setValue("attachedPermanent", game.getPermanent(event.getSourceId()));
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue