From 89baf486bb3b4eb24ca1160e793af5928f316679 Mon Sep 17 00:00:00 2001 From: MEEPofFaith <54301439+MEEPofFaith@users.noreply.github.com> Date: Sun, 22 Oct 2023 11:45:18 -0700 Subject: [PATCH] Fix #41 Since assets are not loaded on headless, fullIcon would be null. Just skip setting clipsize if headless. --- .../world/blocks/defence/turret/energy/SwordTurret.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/progressed/world/blocks/defence/turret/energy/SwordTurret.java b/src/progressed/world/blocks/defence/turret/energy/SwordTurret.java index aae4e8d6..e947aa1a 100644 --- a/src/progressed/world/blocks/defence/turret/energy/SwordTurret.java +++ b/src/progressed/world/blocks/defence/turret/energy/SwordTurret.java @@ -116,7 +116,7 @@ public void init(){ if(buildY == Float.NEGATIVE_INFINITY) buildY = size * Vars.tilesize / 2f; if(elevation < 0) elevation = size / 2f; - clipSize = Math.max(clipSize, Math.abs(buildY) + swordType.fullIcon.height / 4f); + if(!headless) clipSize = Math.max(clipSize, Math.abs(buildY) + swordType.fullIcon.height / 4f); if(targetColor != null) clipSize = Math.max(clipSize, range + targetRad); if(targetY == Float.NEGATIVE_INFINITY) targetY = size * Vars.tilesize / 2f; }