diff options
author | Pacien TRAN-GIRARD | 2016-04-10 23:17:31 +0200 |
---|---|---|
committer | Pacien TRAN-GIRARD | 2016-04-10 23:17:31 +0200 |
commit | 7ff603fe5ca53195881cec8a691fe2b095cf9e12 (patch) | |
tree | 4c68c0f096c1d2bf45b98c3a6abb0dbfd63d1e65 | |
parent | b0f608bb50b9a58a3ea4ebc7eb7be95e771aa360 (diff) | |
download | xblast-7ff603fe5ca53195881cec8a691fe2b095cf9e12.tar.gz |
Delay stop event to next central SubCell
-rw-r--r-- | src/ch/epfl/xblast/server/GameState.java | 3 |
1 files changed, 2 insertions, 1 deletions
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 { | |||
232 | return p0; | 232 | return p0; |
233 | 233 | ||
234 | if (!newDir.isPresent()) | 234 | if (!newDir.isPresent()) |
235 | return Player.DirectedPosition.stopped(p0.head()); | 235 | // TODO: make this clearer |
236 | return GameState.pathToNextCentralPosition(p0).concat(Player.DirectedPosition.stopped(new Player.DirectedPosition(GameState.nextCentralPosition(p0), p0.head().direction()))); | ||
236 | 237 | ||
237 | if (p0.head().direction().isPerpendicularTo(newDir.get())) | 238 | if (p0.head().direction().isPerpendicularTo(newDir.get())) |
238 | return GameState.pivotPath(Player.DirectedPosition.moving(p0.head()), newDir.get()); | 239 | return GameState.pivotPath(Player.DirectedPosition.moving(p0.head()), newDir.get()); |