diff --git a/core/src/mindustry/world/blocks/logic/LogicBlock.java b/core/src/mindustry/world/blocks/logic/LogicBlock.java index fdbb15aea2..d8871484ff 100644 --- a/core/src/mindustry/world/blocks/logic/LogicBlock.java +++ b/core/src/mindustry/world/blocks/logic/LogicBlock.java @@ -140,7 +140,7 @@ public class LogicBlock extends Block{ int bytelen = stream.readInt(); - //if(bytelen > maxByteLen) throw new RuntimeException("Malformed logic data! Length: " + bytelen); + if(bytelen > maxByteLen) throw new RuntimeException("Malformed logic data! Length: " + bytelen); byte[] bytes = new byte[bytelen]; stream.readFully(bytes); @@ -202,7 +202,7 @@ public class LogicBlock extends Block{ int version = stream.read(); int bytelen = stream.readInt(); - //if(bytelen > maxByteLen) throw new RuntimeException("Malformed logic data! Length: " + bytelen); + if(bytelen > maxByteLen) throw new RuntimeException("Malformed logic data! Length: " + bytelen); byte[] bytes = new byte[bytelen]; stream.readFully(bytes); diff --git a/tests/src/test/java/ApplicationTests.java b/tests/src/test/java/ApplicationTests.java index 5895b7fe10..7ae2a1a090 100644 --- a/tests/src/test/java/ApplicationTests.java +++ b/tests/src/test/java/ApplicationTests.java @@ -494,10 +494,12 @@ public class ApplicationTests{ @Test void buildingOverlap(){ + Log.info("Testing buildingOverlap, initialized = @", initialized); + initBuilding(); - Builderc d1 = (Builderc)UnitTypes.poly.create(Team.sharded); - Builderc d2 = (Builderc)UnitTypes.poly.create(Team.sharded); + Unit d1 = UnitTypes.poly.create(Team.sharded); + Unit d2 = UnitTypes.poly.create(Team.sharded); //infinite build range state.rules.editor = true;