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. */
|
||||
public int width, height;
|
||||
/** Preview texture. */
|
||||
public Texture texture;
|
||||
public @Nullable Texture texture;
|
||||
/** Build that this map was created in. -1 = unknown or custom build. */
|
||||
public int build;
|
||||
/** All teams present on this map.*/
|
||||
|
||||
@@ -238,10 +238,13 @@ public class Maps{
|
||||
}
|
||||
|
||||
Pixmap pix = MapIO.generatePreview(world.tiles);
|
||||
mainExecutor.submit(() -> map.previewFile().writePng(pix));
|
||||
writeCache(map);
|
||||
|
||||
map.texture = new Texture(pix);
|
||||
mainExecutor.submit(() -> {
|
||||
map.previewFile().writePng(pix);
|
||||
pix.dispose();
|
||||
});
|
||||
}
|
||||
maps.add(map);
|
||||
maps.sort();
|
||||
|
||||
Reference in New Issue
Block a user