diff --git a/core/src/mindustry/mod/ContentParser.java b/core/src/mindustry/mod/ContentParser.java index 506df53c1b..645b188042 100644 --- a/core/src/mindustry/mod/ContentParser.java +++ b/core/src/mindustry/mod/ContentParser.java @@ -461,12 +461,13 @@ public class ContentParser{ } var typeVal = value.get("type"); + if(unit.constructor == null || typeVal != null){ + if(typeVal != null && !typeVal.isString()){ + throw new RuntimeException("Unit '" + name + "' has an incorrect type. Types must be strings."); + } - if(typeVal != null && !typeVal.isString()){ - throw new RuntimeException("Unit '" + name + "' has an incorrect type. Types must be strings."); + unit.constructor = unitType(typeVal); } - - unit.constructor = unitType(typeVal); }else{ unit = locate(ContentType.unit, name); }