mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +00:00
Fix infinite loop OOM crash (#8254)
This commit is contained in:
committed by
Hans Mackowiak
parent
db5ea3ec9c
commit
cc2f46795f
@@ -256,6 +256,15 @@ public class MagicStack /* extends MyObservable */ implements Iterable<SpellAbil
|
|||||||
System.out.println(source.getName() + " - activatingPlayer not set before adding to stack.");
|
System.out.println(source.getName() + " - activatingPlayer not set before adding to stack.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Stop infinite loop. E.g. Scalelord Reckoner mirrormatch with only triggering targets is a draw.
|
||||||
|
if (game.getStack().size() > 999) {
|
||||||
|
for (Player p : game.getPlayers()) {
|
||||||
|
p.intentionalDraw();
|
||||||
|
}
|
||||||
|
game.setGameOver(GameEndReason.Draw);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
recordUndoableActions(sp, activator);
|
recordUndoableActions(sp, activator);
|
||||||
|
|
||||||
if (sp.isManaAbility()) { // Mana Abilities go straight through
|
if (sp.isManaAbility()) { // Mana Abilities go straight through
|
||||||
|
|||||||
Reference in New Issue
Block a user