diff --git a/core/src/mindustry/entities/comp/WaterMoveComp.java b/core/src/mindustry/entities/comp/WaterMoveComp.java index 346a2898f8..220386e31d 100644 --- a/core/src/mindustry/entities/comp/WaterMoveComp.java +++ b/core/src/mindustry/entities/comp/WaterMoveComp.java @@ -15,6 +15,8 @@ import mindustry.type.*; import mindustry.world.*; import mindustry.world.blocks.environment.*; +import static mindustry.Vars.*; + @Component abstract class WaterMoveComp implements Posc, Velc, Hitboxc, Flyingc, Unitc{ @Import float x, y, rotation; @@ -31,7 +33,7 @@ abstract class WaterMoveComp implements Posc, Velc, Hitboxc, Flyingc, Unitc{ int sign = i == 0 ? -1 : 1; float cx = Angles.trnsx(rotation - 90, type.trailX * sign, type.trailY) + x, cy = Angles.trnsy(rotation - 90, type.trailX * sign, type.trailY) + y; - t.update(cx, cy); + t.update(cx, cy, world.floorWorld(cx, cy).isLiquid ? 1 : 0); } } diff --git a/core/src/mindustry/graphics/Trail.java b/core/src/mindustry/graphics/Trail.java index fc998e64ea..5fc194c51d 100644 --- a/core/src/mindustry/graphics/Trail.java +++ b/core/src/mindustry/graphics/Trail.java @@ -40,6 +40,7 @@ public class Trail{ float[] items = points.items; int i = points.size - 3; float x1 = items[i], y1 = items[i + 1], w1 = items[i + 2], w = w1 * width / (points.size/3) * i/3f * 2f; + if(w1 <= 0.001f) return; Draw.rect("hcircle", x1, y1, w, w, -Mathf.radDeg * lastAngle + 180f); Draw.reset(); } @@ -56,6 +57,7 @@ public class Trail{ float size = width / (points.size/3); float z1 = lastAngle; float z2 = -Angles.angleRad(x2, y2, lx, ly); + if(w1 <= 0.001f || w2 <= 0.001f) continue; float cx = Mathf.sin(z1) * i/3f * size * w1, cy = Mathf.cos(z1) * i/3f * size * w1, nx = Mathf.sin(z2) * (i/3f + 1) * size * w2, ny = Mathf.cos(z2) * (i/3f + 1) * size * w2;