diff --git a/core/src/mindustry/entities/Damage.java b/core/src/mindustry/entities/Damage.java index 62b110dce8..e714b410ed 100644 --- a/core/src/mindustry/entities/Damage.java +++ b/core/src/mindustry/entities/Damage.java @@ -178,8 +178,6 @@ public class Damage{ } public static float findPierceLength(Bullet b, int pierceCap, boolean laser, float length){ - if(pierceCap <= 0) return length; - vec.trnsExact(b.rotation(), length); rect.setPosition(b.x, b.y).setSize(vec.x, vec.y).normalize().grow(3f); @@ -217,7 +215,7 @@ public class Damage{ //return either the length when not enough things were pierced, //or the last pierced object if there were enough blockages - return Math.min(distances.size < pierceCap ? length : Math.max(6f, distances.get(pierceCap - 1)), maxDst); + return Math.min(distances.size < pierceCap || pierceCap <= 0 ? length : Math.max(6f, distances.get(pierceCap - 1)), maxDst); } /** Collides a bullet with blocks in a laser, taking into account absorption blocks. Resulting length is stored in the bullet's fdata. */ diff --git a/core/src/mindustry/world/blocks/distribution/StackConveyor.java b/core/src/mindustry/world/blocks/distribution/StackConveyor.java index 2897938e25..86da096357 100644 --- a/core/src/mindustry/world/blocks/distribution/StackConveyor.java +++ b/core/src/mindustry/world/blocks/distribution/StackConveyor.java @@ -141,7 +141,7 @@ public class StackConveyor extends Block implements Autotiler{ } }else if(state == stateUnload){ //front unload //TOOD hacky front check - if((blendprox & (1)) != 0 && !front().block.squareSprite){ + if((blendprox & (1)) != 0 && front() != null && !front().block.squareSprite){ Draw.rect(sliced(regions[0], SliceMode.top), x + Geometry.d4x(rotation) * tilesize*0.75f, y + Geometry.d4y(rotation) * tilesize*0.75f, rotation * 90f); } }