From 9baaacc8acd6e1bb73eab916f944d514a72b4fed Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 26 Jan 2020 16:55:24 -0500 Subject: [PATCH] Crash fix --- core/src/mindustry/world/blocks/distribution/Conveyor.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/world/blocks/distribution/Conveyor.java b/core/src/mindustry/world/blocks/distribution/Conveyor.java index bc296e2c41..28cc465743 100644 --- a/core/src/mindustry/world/blocks/distribution/Conveyor.java +++ b/core/src/mindustry/world/blocks/distribution/Conveyor.java @@ -363,9 +363,10 @@ public class Conveyor extends Block implements Autotiler{ @Override public void read(DataInput stream, byte revision) throws IOException{ super.read(stream, revision); - len = stream.readInt(); + int amount = stream.readInt(); + len = Math.min(amount, capacity); - for(int i = 0; i < len; i++){ + for(int i = 0; i < amount; i++){ int val = stream.readInt(); byte id = (byte)(val >> 24); float x = (float)((byte)(val >> 16)) / 127f;