egordorichev / LastTry

:deciduous_tree: LastTry is open-source game written in Java, using LibGDX library and inspired by Terraria :deciduous_tree:
MIT License
118 stars 17 forks source link

Crash on chunk GC #94

Closed Col-E closed 7 years ago

Col-E commented 7 years ago

Left game idle for about 30 seconds, crash occurs due to the save file name not being structured properly. For example it searched for the given file: C:\Users\Matt/.LastTry/worlds/test/0.0.cnk

Exit trace:

java.lang.Exception: Exit trace
    at java.lang.System.exit(System.java:971)
    at org.egordorichev.lasttry.LastTry.abort(LastTry.java:190)
    at org.egordorichev.lasttry.world.chunk.ChunkIO.save(ChunkIO.java:100)
    at org.egordorichev.lasttry.world.components.WorldChunksComponent.removeChunk(WorldChunksComponent.java:138)
    at org.egordorichev.lasttry.world.chunk.gc.ChunkGc.lambda$0(ChunkGc.java:75)
    at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1374)
    at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
    at org.egordorichev.lasttry.world.chunk.gc.ChunkGc.freeChunks(ChunkGc.java:74)
    at org.egordorichev.lasttry.world.chunk.gc.ChunkGc.performChunkGc(ChunkGc.java:37)
    at org.egordorichev.lasttry.world.chunk.gc.ChunkGc.beginChunkGC(ChunkGc.java:29)
    at org.egordorichev.lasttry.world.chunk.gc.ChunkGc.onWakeUp(ChunkGc.java:21)
    at org.egordorichev.lasttry.world.chunk.gc.ChunkGcManager$1.call(ChunkGcManager.java:70)
Col-E commented 7 years ago

Fixed in https://github.com/egordorichev/LastTry/pull/95