* Halvar, God of Battle - fixed rollback error on attached permanent die;

This commit is contained in:
Oleg Agafonov 2021-03-07 18:28:19 +04:00
parent 0e916b6e29
commit 6e661e6d97
4 changed files with 10 additions and 6 deletions

View file

@ -55,8 +55,8 @@ public class AttacksWithCreaturesTriggeredAbility extends TriggeredAbilityImpl {
if (game.getCombat().getAttackingPlayerId().equals(getControllerId())) {
int attackerCount = 0;
for (UUID attackerId : game.getCombat().getAttackers()) {
Permanent permanent = game.getPermanent(attackerId);
if (permanent != null && filter.match(game.getPermanent(attackerId), game)) {
Permanent attacker = game.getPermanent(attackerId);
if (attacker != null && filter.match(attacker, game)) {
attackerCount++;
}
}

View file

@ -22,7 +22,8 @@ public class AttachedToPredicate implements Predicate<Permanent> {
@Override
public boolean apply(Permanent input, Game game) {
UUID attachedTo = input.getAttachedTo();
return attachedTo != null && filter.match(game.getPermanent(attachedTo), game);
Permanent permanent = game.getPermanent(attachedTo);
return permanent != null && filter.match(permanent, game);
}
@Override