From 764a77b69e61a364b41deb7e7e12ca6aa81839d7 Mon Sep 17 00:00:00 2001 From: tool4EvEr Date: Fri, 16 Jul 2021 09:44:11 +0200 Subject: [PATCH] Fix infinite loop when lib empties --- .../src/main/java/forge/game/ability/effects/RepeatEffect.java | 2 +- forge-gui/res/cardsfolder/upcoming/tashas_hideous_laughter.txt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/forge-game/src/main/java/forge/game/ability/effects/RepeatEffect.java b/forge-game/src/main/java/forge/game/ability/effects/RepeatEffect.java index 5c384cd1401..92652afa881 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/RepeatEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/RepeatEffect.java @@ -49,7 +49,7 @@ public class RepeatEffect extends SpellAbilityEffect { // TODO Replace Infinite Loop Break with a game draw. Here are the scenarios that can cause this: // Helm of Obedience vs Graveyard to Library replacement effect - if(source.getName().equals("Helm of Obedience")) { + if (source.getName().equals("Helm of Obedience")) { StringBuilder infLoop = new StringBuilder(sa.getHostCard().toString()); infLoop.append(" - To avoid an infinite loop, this repeat has been broken "); infLoop.append(" and the game will now continue in the current state, ending the loop early. "); diff --git a/forge-gui/res/cardsfolder/upcoming/tashas_hideous_laughter.txt b/forge-gui/res/cardsfolder/upcoming/tashas_hideous_laughter.txt index adca1ec2a29..51c7622eceb 100644 --- a/forge-gui/res/cardsfolder/upcoming/tashas_hideous_laughter.txt +++ b/forge-gui/res/cardsfolder/upcoming/tashas_hideous_laughter.txt @@ -2,8 +2,9 @@ Name:Tasha's Hideous Laughter ManaCost:1 U U Types:Sorcery A:SP$ RepeatEach | RepeatPlayers$ Opponent | RepeatSubAbility$ DBRepeat | SpellDescription$ Each opponent exiles cards from the top of their library until that player has exiled cards with total mana value 20 or more. -SVar:DBRepeat:DB$ Repeat | RepeatSubAbility$ DBExile | RepeatCheckSVar$ X | RepeatSVarCompare$ LT20 | SubAbility$ DBCleanup +SVar:DBRepeat:DB$ Repeat | RepeatSubAbility$ DBExile | RepeatCheckSVar$ X | RepeatSVarCompare$ LT20 | MaxRepeat$ Y | SubAbility$ DBCleanup SVar:DBExile:DB$ Dig | Defined$ Remembered | DigNum$ 1 | ChangeNum$ All | DestinationZone$ Exile | Imprint$ True SVar:DBCleanup:DB$ Cleanup | ClearImprinted$ True SVar:X:Imprinted$CardManaCost +SVar:Y:PlayerCountRemembered$CardsInLibrary Oracle:Each opponent exiles cards from the top of their library until that player has exiled cards with total mana value 20 or more.