From 46d1384aa65a6553fecef931768016ebb6efd5d3 Mon Sep 17 00:00:00 2001 From: Paul Wedeck Date: Sun, 9 Oct 2022 17:12:59 +0200 Subject: [PATCH] temporary fix deserialization of MovablePathfinderGrid --- .../main/java/jsettlers/logic/map/grid/MainGrid.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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);