Possible crash fix with editor saving
This commit is contained in:
@@ -31,7 +31,7 @@ public class Map implements Comparable<Map>, Publishable{
|
|||||||
/** Map width/height, shorts. */
|
/** Map width/height, shorts. */
|
||||||
public int width, height;
|
public int width, height;
|
||||||
/** Preview texture. */
|
/** Preview texture. */
|
||||||
public Texture texture;
|
public @Nullable Texture texture;
|
||||||
/** Build that this map was created in. -1 = unknown or custom build. */
|
/** Build that this map was created in. -1 = unknown or custom build. */
|
||||||
public int build;
|
public int build;
|
||||||
/** All teams present on this map.*/
|
/** All teams present on this map.*/
|
||||||
|
|||||||
@@ -238,10 +238,13 @@ public class Maps{
|
|||||||
}
|
}
|
||||||
|
|
||||||
Pixmap pix = MapIO.generatePreview(world.tiles);
|
Pixmap pix = MapIO.generatePreview(world.tiles);
|
||||||
mainExecutor.submit(() -> map.previewFile().writePng(pix));
|
|
||||||
writeCache(map);
|
writeCache(map);
|
||||||
|
|
||||||
map.texture = new Texture(pix);
|
map.texture = new Texture(pix);
|
||||||
|
mainExecutor.submit(() -> {
|
||||||
|
map.previewFile().writePng(pix);
|
||||||
|
pix.dispose();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
maps.add(map);
|
maps.add(map);
|
||||||
maps.sort();
|
maps.sort();
|
||||||
|
|||||||
Reference in New Issue
Block a user