From 9889baa0bcda004e56e2540bc80e212e58d3cbb5 Mon Sep 17 00:00:00 2001 From: Susucre <34709007+Susucre@users.noreply.github.com> Date: Sat, 5 Aug 2023 00:09:43 +0200 Subject: [PATCH] Fix game freeze caused by TotalPermanentsManaValue hint copy (#10751) --- .../common/TotalPermanentsManaValue.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/TotalPermanentsManaValue.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/TotalPermanentsManaValue.java index 5bdffcb1a82..861ea889ee9 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/TotalPermanentsManaValue.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/TotalPermanentsManaValue.java @@ -14,19 +14,16 @@ import java.util.List; public class TotalPermanentsManaValue implements DynamicValue { private final String message; - private final ValueHint hint; private final FilterPermanent filter; public TotalPermanentsManaValue(FilterPermanent filter) { this.filter = filter.copy(); this.message = "the total mana value of " + filter.getMessage(); - this.hint = new ValueHint("Total mana value of " + filter.getMessage(), this); } private TotalPermanentsManaValue(final TotalPermanentsManaValue value) { this.filter = value.filter.copy(); this.message = value.message; - this.hint = value.hint.copy(); } @Override @@ -38,10 +35,10 @@ public class TotalPermanentsManaValue implements DynamicValue { public int calculate(Game game, Ability sourceAbility, Effect effect) { int totalCMC = 0; List permanents = game.getBattlefield().getActivePermanents( - filter, - sourceAbility.getControllerId(), - sourceAbility, - game); + filter, + sourceAbility.getControllerId(), + sourceAbility, + game); for (Permanent permanent : permanents) { totalCMC += permanent.getManaValue(); } @@ -59,6 +56,6 @@ public class TotalPermanentsManaValue implements DynamicValue { } public Hint getHint() { - return hint; + return new ValueHint("Total mana value of " + filter.getMessage(), this); } }