* Triggered abilities - Fixed a bug that triggered abilities triggered not at the correct time but too late.

This commit is contained in:
LevelX2 2014-06-12 21:09:59 +02:00
parent b964758325
commit c0aa97802e

View file

@ -1041,13 +1041,8 @@ public abstract class GameImpl implements Game, Serializable {
state.setPriorityPlayerId(player.getId()); state.setPriorityPlayerId(player.getId());
while (!player.isPassed() && player.isInGame() && !isPaused() && !gameOver(null)) { while (!player.isPassed() && player.isInGame() && !isPaused() && !gameOver(null)) {
if (!resuming) { if (!resuming) {
if (checkStateAndTriggered()) { // 603.3. Once an ability has triggered, its controller puts it on the stack as an object that’s not a card the next time a player would receive priority
do { checkStateAndTriggered();
state.handleSimultaneousEvent(this);
applyEffects();
} while (state.hasSimultaneousEvents());
}
//resetLKI();
applyEffects(); applyEffects();
saveState(false); saveState(false);
if (isPaused() || gameOver(null)) { if (isPaused() || gameOver(null)) {
@ -1272,6 +1267,7 @@ public abstract class GameImpl implements Game, Serializable {
//20091005 - 115.5 //20091005 - 115.5
while (!isPaused() && !gameOver(null)) { while (!isPaused() && !gameOver(null)) {
if (!checkStateBasedActions() ) { if (!checkStateBasedActions() ) {
state.handleSimultaneousEvent(this);
if (isPaused() || gameOver(null) || !checkTriggered()) { if (isPaused() || gameOver(null) || !checkTriggered()) {
break; break;
} }