From e4ceff01d46b7a1a27ef216791ace425c448acdb Mon Sep 17 00:00:00 2001 From: Anuken Date: Sat, 20 Jun 2026 16:21:00 -0400 Subject: [PATCH] Fixed NaN black screen --- core/src/mindustry/editor/MapView.java | 3 +++ core/src/mindustry/mod/DataImagePacker.java | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/editor/MapView.java b/core/src/mindustry/editor/MapView.java index e030350238..0190b0081d 100644 --- a/core/src/mindustry/editor/MapView.java +++ b/core/src/mindustry/editor/MapView.java @@ -233,6 +233,9 @@ public class MapView extends Element implements GestureListener{ @Override public void draw(){ + //can cause NaN + if(editor.width() == 0 || editor.height() == 0) return; + float ratio = 1f / ((float)editor.width() / editor.height()); float size = Math.min(width, height); float sclwidth = size * zoom; diff --git a/core/src/mindustry/mod/DataImagePacker.java b/core/src/mindustry/mod/DataImagePacker.java index aeddc5aca5..4183d860bd 100644 --- a/core/src/mindustry/mod/DataImagePacker.java +++ b/core/src/mindustry/mod/DataImagePacker.java @@ -144,7 +144,6 @@ public class DataImagePacker{ packer.forceDispose(); - //getRegions is intentionally not modified, it's a hassle to manage, O(n) to unapply, and not used anywhere important. there's no point. //the drawable map isn't used, and thus not modified either