From 505c434fb5c797c25781de7a99a43eae9c18eac3 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Fri, 24 Apr 2020 20:26:02 -0400 Subject: [PATCH] added another fix for Valiant Rescuer --- Mage.Sets/src/mage/cards/v/ValiantRescuer.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Mage.Sets/src/mage/cards/v/ValiantRescuer.java b/Mage.Sets/src/mage/cards/v/ValiantRescuer.java index 7d38500ca2..768dc200e4 100644 --- a/Mage.Sets/src/mage/cards/v/ValiantRescuer.java +++ b/Mage.Sets/src/mage/cards/v/ValiantRescuer.java @@ -94,7 +94,7 @@ class ValiantRescuerTriggeredAbility extends TriggeredAbilityImpl { class ValiantRescuerWatcher extends Watcher { - private final Map> playerMap = new HashMap(); + private final Map> playerMap = new HashMap<>(); ValiantRescuerWatcher() { super(WatcherScope.GAME); @@ -109,8 +109,10 @@ class ValiantRescuerWatcher extends Watcher { StackObject item = game.getState().getStack().getFirst(); if (item instanceof StackAbility && item.getStackAbility() instanceof CyclingAbility) { - playerMap.computeIfAbsent(event.getPlayerId(), u -> new HashMap()); - playerMap.get(event.getPlayerId()).compute(event.getSourceId(), (u, i) -> i == null ? 1 : i + 1); + playerMap.computeIfAbsent(event.getPlayerId(), u -> new HashMap<>()); + playerMap.get(event.getPlayerId()).compute( + event.getSourceId(), (u, i) -> i == null ? 1 : Integer.sum(i, 1) + ); } }