mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
Fixes #468 :Rollback on error doesn't work
This commit is contained in:
parent
c03dc6c2b5
commit
edd1563c12
1 changed files with 5 additions and 6 deletions
|
@ -1034,8 +1034,9 @@ public abstract class GameImpl implements Game, Serializable {
|
|||
Player player;
|
||||
while (!isPaused() && !gameOver(null)) {
|
||||
try {
|
||||
//if (bookmark == 0)
|
||||
//bookmark = bookmarkState();
|
||||
if (bookmark == 0) {
|
||||
bookmark = bookmarkState();
|
||||
}
|
||||
player = getPlayer(state.getPlayerList().get());
|
||||
state.setPriorityPlayerId(player.getId());
|
||||
while (!player.isPassed() && player.isInGame() && !isPaused() && !gameOver(null)) {
|
||||
|
@ -1073,7 +1074,6 @@ public abstract class GameImpl implements Game, Serializable {
|
|||
resetShortLivingLKI();
|
||||
break;
|
||||
} else {
|
||||
//removeBookmark(bookmark);
|
||||
resetLKI();
|
||||
return;
|
||||
}
|
||||
|
@ -1083,20 +1083,19 @@ public abstract class GameImpl implements Game, Serializable {
|
|||
logger.fatal("Game exception ", ex);
|
||||
ex.printStackTrace();
|
||||
this.fireErrorEvent("Game exception occurred: ", ex);
|
||||
//restoreState(bookmark);
|
||||
restoreState(bookmark);
|
||||
bookmark = 0;
|
||||
continue;
|
||||
}
|
||||
state.getPlayerList().getNext();
|
||||
}
|
||||
//removeBookmark(bookmark);
|
||||
bookmark = 0;
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
logger.fatal("Game exception ", ex);
|
||||
this.fireErrorEvent("Game exception occurred: ", ex);
|
||||
} finally {
|
||||
resetLKI();
|
||||
clearAllBookmarks();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue