diff --git a/core/src/mindustry/type/UnitType.java b/core/src/mindustry/type/UnitType.java index 3777239266..7a4ba69c6c 100644 --- a/core/src/mindustry/type/UnitType.java +++ b/core/src/mindustry/type/UnitType.java @@ -611,6 +611,16 @@ public class UnitType extends UnlockableContent{ } } + //never actually called; it turns out certain mods have custom weapons that do not need bullets. + protected void validateWeapons(){ + for(int i = 0; i < weapons.size; i++){ + var wep = weapons.get(i); + if(wep.bullet == Bullets.placeholder || wep.bullet == null){ + throw new RuntimeException("Unit: " + name + ": weapon #" + i + " ('" + wep.name + "') does not have a bullet defined. Make sure you have a bullet: (JSON) or `bullet = ` field in your unit definition."); + } + } + } + @CallSuper @Override public void init(){ @@ -631,13 +641,6 @@ public class UnitType extends UnlockableContent{ } } - for(int i = 0; i < weapons.size; i++){ - var wep = weapons.get(i); - if(wep.bullet == Bullets.placeholder || wep.bullet == null){ - throw new RuntimeException("Unit: " + name + ": weapon #" + i + " ('" + wep.name + "') does not have a bullet defined. Make sure you have a bullet: (JSON) or `bullet = ` field in your unit definition."); - } - } - if(pathCost == null){ pathCost = example instanceof WaterMovec ? ControlPathfinder.costNaval : diff --git a/core/src/mindustry/world/Block.java b/core/src/mindustry/world/Block.java index cf4ed7e7b3..79c0bf36ce 100644 --- a/core/src/mindustry/world/Block.java +++ b/core/src/mindustry/world/Block.java @@ -1269,12 +1269,13 @@ public class Block extends UnlockableContent implements Senseable{ var gen = icons(); if(outlineIcon){ - PixmapRegion region = Core.atlas.getPixmap(gen[outlinedIcon >= 0 ? Math.min(outlinedIcon, gen.length - 1) : gen.length -1]); + AtlasRegion atlasRegion = (AtlasRegion)gen[outlinedIcon >= 0 ? Math.min(outlinedIcon, gen.length - 1) : gen.length -1]; + PixmapRegion region = Core.atlas.getPixmap(atlasRegion); Pixmap out = last = Pixmaps.outline(region, outlineColor, outlineRadius); if(Core.settings.getBool("linear", true)){ Pixmaps.bleed(out); } - packer.add(PageType.main, name, out); + packer.add(PageType.main, atlasRegion.name, out); } var toOutline = new Seq(); diff --git a/core/src/mindustry/world/draw/DrawTurret.java b/core/src/mindustry/world/draw/DrawTurret.java index 7289441c2e..4bc4fb0e0c 100644 --- a/core/src/mindustry/world/draw/DrawTurret.java +++ b/core/src/mindustry/world/draw/DrawTurret.java @@ -37,7 +37,7 @@ public class DrawTurret extends DrawBlock{ part.getOutlines(out); } - if(block.region.found() && !Core.atlas.has(block.name + "-preview")){ + if(block.region.found()){ out.add(block.region); } }