diff --git a/jsettlers.logic/src/main/java/jsettlers/logic/map/grid/MainGrid.java b/jsettlers.logic/src/main/java/jsettlers/logic/map/grid/MainGrid.java index df241e31b..9929f18d8 100644 --- a/jsettlers.logic/src/main/java/jsettlers/logic/map/grid/MainGrid.java +++ b/jsettlers.logic/src/main/java/jsettlers/logic/map/grid/MainGrid.java @@ -235,7 +235,6 @@ private void readObject(ObjectInputStream ois) throws IOException, ClassNotFound ois.defaultReadObject(); initAdditional(); this.bordersThread.checkArea(0, 0, width, height); - movablePathfinderGrid.initPathfinders(); } public void startThreads() { @@ -1228,11 +1227,16 @@ final class MovablePathfinderGrid extends AbstractMovableGrid { transient DijkstraAlgorithm dijkstra; // not private, because it's used by BuildingsGrid private transient InAreaFinder inAreaFinder; + private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException { + ois.defaultReadObject(); + initPathfinders(width, height); + } + public MovablePathfinderGrid() { - initPathfinders(); + initPathfinders(width, height); } - private void initPathfinders() { + private void initPathfinders(short width, short height) { pathfinderGrid = new PathfinderGrid(); aStar = new BucketQueueAStar(pathfinderGrid, width, height);