private void SetupSubtypes()
{
foreach (var subtype in subtypes)
{
if (subtype.tankType == null)
LogError($"Tank is null on subtype {subtype.Name}");
if (subtype.tankType.ResourcesCount > 0 && (subtype.TotalVolume <= 0f))
{
LogError($"Subtype {subtype.Name} has a tank type with resources, but no volume is specifified");
subtype.AssignStructuralTankType();
}
}
if (PartFieldManaged(SubtypePartFields.SrfAttachNode) && !part.attachRules.allowSrfAttach || part.srfAttachNode.IsNull())
{
LogError($"Error: One or more subtypes have an attach node defined, but part does not allow surface attachment (or the surface attach node could not be found)");
subtypes.ForEach(subtype => subtype.ClearAttachNode());
}
}