From cfda2d8f300c672b4d73ad79df3f20888965815d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 12 Apr 2016 17:07:02 +0200 Subject: Map5Marshal: dump orderId before other attributes --- core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java b/core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java index 4214d7e..f13951d 100644 --- a/core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java +++ b/core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java @@ -157,8 +157,8 @@ public abstract class Map5Marshal extends Map4Orders implements Marshal json.writeArrayStart("orders"); for (Order o : orders) { json.writeObjectStart(); - json.writeValue("type", o.type); json.writeValue("oId", o.orderId); + json.writeValue("type", o.type); json.writeValue("cost", o.cost); switch(o.type) { case MOVE: @@ -366,6 +366,7 @@ public abstract class Map5Marshal extends Map4Orders implements Marshal for (int i = 0; i < v.size; i++) { JsonValue o = v.get(i); Order order = null; + order.orderId = o.getInt("oId"); switch(Order.OrderType.valueOf(o.getString("type"))) { case MOVE: order = loadMoveOrder(o); @@ -378,7 +379,6 @@ public abstract class Map5Marshal extends Map4Orders implements Marshal break; } order.cost = o.getInt("cost"); - order.orderId = o.getInt("oId"); JsonValue a = o.get("a"); if (a != null) { for (int j = 0; j < a.size; j++) { -- cgit v1.1-2-g2b99