Skip to content

Commit

Permalink
temporary fix deserialization of MovablePathfinderGrid
Browse files Browse the repository at this point in the history
  • Loading branch information
paulwedeck committed Oct 9, 2022
1 parent 661225a commit 46d1384
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 46d1384

Please sign in to comment.