Make type not required if the template already provides one (#8257)
Such as with missile units
This commit is contained in:
@@ -461,12 +461,13 @@ public class ContentParser{
|
|||||||
}
|
}
|
||||||
|
|
||||||
var typeVal = value.get("type");
|
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()){
|
unit.constructor = unitType(typeVal);
|
||||||
throw new RuntimeException("Unit '" + name + "' has an incorrect type. Types must be strings.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
unit.constructor = unitType(typeVal);
|
|
||||||
}else{
|
}else{
|
||||||
unit = locate(ContentType.unit, name);
|
unit = locate(ContentType.unit, name);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user