Skip to content

Commit

Permalink
Fix sorting maps as previews are loading which can cause potential is…
Browse files Browse the repository at this point in the history
…sues
  • Loading branch information
buthed010203 committed May 6, 2024
1 parent c9b4744 commit 2432a4d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions core/src/mindustry/maps/Maps.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,7 @@ public Map byName(String name){
}

public Maps(){
Events.on(ClientLoadEvent.class, event -> {
loadPreviews();

maps.sort();
});
Events.on(ClientLoadEvent.class, event -> loadPreviews());
}

/**
Expand Down Expand Up @@ -419,6 +415,7 @@ private void nextSync() {
if(lastPreview == Core.graphics.getFrameId()) return;
if(queuedPreviews.isEmpty()){
loader = null;
maps.sort();
return;
}
lastPreview = Core.graphics.getFrameId();
Expand Down

0 comments on commit 2432a4d

Please sign in to comment.