From 3258de194b3c7a39f891152d89c9dd428c2f1b39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Wed, 30 Mar 2016 16:14:23 +0200 Subject: Ctrl: for now no replay if turn just ended --- core/src/ch/asynk/rustanddust/game/Ctrl.java | 8 ++++++-- core/src/ch/asynk/rustanddust/util/DB.java | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/core/src/ch/asynk/rustanddust/game/Ctrl.java b/core/src/ch/asynk/rustanddust/game/Ctrl.java index 01dc202..fab6f01 100644 --- a/core/src/ch/asynk/rustanddust/game/Ctrl.java +++ b/core/src/ch/asynk/rustanddust/game/Ctrl.java @@ -117,8 +117,12 @@ public abstract class Ctrl implements Disposable // TODO REPLAY_ALL break; case REPLAY_LAST: - map.prepareReplayLastTurn(); - setState(StateType.REPLAY); + if (synched) { + this.hud.notify(battle.toString(), 2, Position.MIDDLE_CENTER, false); + } else { + map.prepareReplayLastTurn(); + setState(StateType.REPLAY); + } break; case LOAD: if (synched) { diff --git a/core/src/ch/asynk/rustanddust/util/DB.java b/core/src/ch/asynk/rustanddust/util/DB.java index 7b5a661..994e5d3 100644 --- a/core/src/ch/asynk/rustanddust/util/DB.java +++ b/core/src/ch/asynk/rustanddust/util/DB.java @@ -347,7 +347,7 @@ public class DB return r; } - private static final String LOAD_LAST_TURN = "select g._id, g.mode, g.battle, g.opponent, t.turn, t.currentPlayer, g.ts, 0" + private static final String LOAD_LAST_TURN = "select g._id, g.mode, g.battle, g.opponent, t.turn, t.currentPlayer, g.ts, g.synched" + ", t.state, t.stateH, g.orders, g.ordersH, null, null from games g inner join turns t on (g._id = t.game) where g._id=%d order by t.turn desc limit 1;"; public GameRecord loadLastTurn(int game) -- cgit v1.1-2-g2b99