From 6b7260250af7513ecf429b7cd009f09e018e409f Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 8 Apr 2024 19:07:58 -0400 Subject: [PATCH] Fixed #9728 --- core/src/mindustry/graphics/Trail.java | 2 +- core/src/mindustry/world/blocks/ConstructBlock.java | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/core/src/mindustry/graphics/Trail.java b/core/src/mindustry/graphics/Trail.java index 426f7215b3..f77a31fd31 100644 --- a/core/src/mindustry/graphics/Trail.java +++ b/core/src/mindustry/graphics/Trail.java @@ -66,7 +66,7 @@ public class Trail{ y2 = items[i + 4]; w2 = items[i + 5]; - if(i == 0){ + if(i == 0 && points.size >= (length - 1) * 3){ x1 = Mathf.lerp(x1, x2, counter); y1 = Mathf.lerp(y1, y2, counter); w1 = Mathf.lerp(w1, w2, counter); diff --git a/core/src/mindustry/world/blocks/ConstructBlock.java b/core/src/mindustry/world/blocks/ConstructBlock.java index 1b34d2d994..796c7369bd 100644 --- a/core/src/mindustry/world/blocks/ConstructBlock.java +++ b/core/src/mindustry/world/blocks/ConstructBlock.java @@ -164,9 +164,9 @@ public class ConstructBlock extends Block{ public boolean wasConstructing, activeDeconstruct; public float constructColor; - private float[] accumulator; - private float[] totalAccumulator; - private int[] itemsLeft; + private @Nullable float[] accumulator; + private @Nullable float[] totalAccumulator; + private @Nullable int[] itemsLeft; @Override public String getDisplayName(){ @@ -480,6 +480,7 @@ public class ConstructBlock extends Block{ if(acsize != -1){ accumulator = new float[acsize]; totalAccumulator = new float[acsize]; + itemsLeft = new int[acsize]; for(int i = 0; i < acsize; i++){ accumulator[i] = read.f(); totalAccumulator[i] = read.f();