Anuken / Mindustry

The automation tower defense RTS
https://mindustrygame.github.io
GNU General Public License v3.0
22.69k stars 2.97k forks source link

Cannot load map file #10117

Closed NoSanityHere closed 2 months ago

NoSanityHere commented 2 months ago

Platforms

Mac

Build

146

Issue

trying to import the ground zero save file gives the error

[E] Failed to load custom map file '/game data path/Mindustry/maps/groundZero.msav'!
[E] java.lang.NullPointerException: Cannot invoke "mindustry.io.SaveVersion.region(String, java.io.DataInput, arc.util.io.CounterInputStream, mindustry.io.SaveFileReader$IORunner)" because "ver" is null
    at mindustry.io.MapIO.createMap(MapIO.java:43)
    at mindustry.maps.Maps.loadMap(Maps.java:464)
    at mindustry.maps.Maps.load(Maps.java:140)
    at mindustry.Vars.init(Vars.java:338)
    at mindustry.Vars.loadAsync(Vars.java:258)
    at arc.assets.AssetManager$2.loadAsync(AssetManager.java:352)
    at arc.assets.AssetLoadingTask.call(AssetLoadingTask.java:52)
    at arc.assets.AssetLoadingTask.call(AssetLoadingTask.java:16)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
    at java.base/java.lang.Thread.run(Thread.java:1583)

ver becomes null in SaveIO.getSaveWriter(int version), the version is 8, but versions.get returns null, and the underlying code is rather confusing

Steps to reproduce

try to import the ground zero save file provided or in https://github.com/Anuken/Mindustry/tree/master/core/assets/maps

Mods used

none

Save file

groundZero.msav.zip

(Crash) logs

No response

Submission

Anuken commented 2 months ago

You're trying to load a map for a newer version of the game.

NoSanityHere commented 2 months ago

oh yeah, sorry to waste your time. could you add a message like this

Anuken commented 2 months ago

I already added a message to the newer version, but you're not using it.