From 7ff603fe5ca53195881cec8a691fe2b095cf9e12 Mon Sep 17 00:00:00 2001 From: Pacien TRAN-GIRARD Date: Sun, 10 Apr 2016 23:17:31 +0200 Subject: Delay stop event to next central SubCell --- src/ch/epfl/xblast/server/GameState.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ch/epfl/xblast/server/GameState.java b/src/ch/epfl/xblast/server/GameState.java index 65309d5..e133159 100644 --- a/src/ch/epfl/xblast/server/GameState.java +++ b/src/ch/epfl/xblast/server/GameState.java @@ -232,7 +232,8 @@ public final class GameState { return p0; if (!newDir.isPresent()) - return Player.DirectedPosition.stopped(p0.head()); + // TODO: make this clearer + return GameState.pathToNextCentralPosition(p0).concat(Player.DirectedPosition.stopped(new Player.DirectedPosition(GameState.nextCentralPosition(p0), p0.head().direction()))); if (p0.head().direction().isPerpendicularTo(newDir.get())) return GameState.pivotPath(Player.DirectedPosition.moving(p0.head()), newDir.get()); -- cgit v1.2.3