summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/rustanddust
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2016-03-30 16:14:23 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2016-03-30 16:14:23 +0200
commit3258de194b3c7a39f891152d89c9dd428c2f1b39 (patch)
tree303232d86fe039dc079b7ba58ae1065bb97e2d17 /core/src/ch/asynk/rustanddust
parent007f93a4fcc3c36a4d1f2730ee63587e8769f4be (diff)
downloadRustAndDust-3258de194b3c7a39f891152d89c9dd428c2f1b39.zip
RustAndDust-3258de194b3c7a39f891152d89c9dd428c2f1b39.tar.gz
Ctrl: for now no replay if turn just ended
Diffstat (limited to 'core/src/ch/asynk/rustanddust')
-rw-r--r--core/src/ch/asynk/rustanddust/game/Ctrl.java8
-rw-r--r--core/src/ch/asynk/rustanddust/util/DB.java2
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)