mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 21:12:04 -08:00
* Fixed a problem of EndTurnEffect not beeing able to remove stackAbilities and endless looping as a result (fixes #3221).
This commit is contained in:
parent
24b99216f8
commit
80beebccf5
2 changed files with 42 additions and 5 deletions
|
|
@ -278,10 +278,12 @@ public class Turn implements Serializable {
|
|||
|
||||
// 1) All spells and abilities on the stack are exiled. This includes (e.g.) Time Stop, though it will continue to resolve.
|
||||
// It also includes spells and abilities that can't be countered.
|
||||
while (!game.getStack().isEmpty()) {
|
||||
while (!game.hasEnded() && !game.getStack().isEmpty()) {
|
||||
StackObject stackObject = game.getStack().peekFirst();
|
||||
if (stackObject instanceof Spell) {
|
||||
((Spell) stackObject).moveToExile(null, "", source.getSourceId(), game);
|
||||
} else {
|
||||
game.getStack().remove(stackObject); // stack ability
|
||||
}
|
||||
}
|
||||
// 2) All attacking and blocking creatures are removed from combat.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue