Skip to content

Commit 019e802

Browse files
committed
Fix #305 : Incorrect parsing of dragModelType part config values resulting in various parts such as wings to generate additional drag
1 parent 18e7080 commit 019e802

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

KSPCommunityFixes/Performance/PartParsingPerf.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -546,9 +546,14 @@ private static void PopulatePartFieldDictionary(Type partType, Dictionary<string
546546

547547
string fieldName = fieldInfo.Name;
548548

549-
if (fieldName == "dragModelType")
549+
if (fieldName == "dragModel")
550550
{
551-
setter = new DragModelTypeSetter();
551+
// The usual way the `dragModel` field is set is through a `dragModelType` config value,
552+
// triggering a code path with custom parsing rules as well as a case-insensitive parsing :
553+
typeSetterDict["dragModelType"] = new DragModelTypeSetter();
554+
// However using the `dragModel` config value is valid as well, but the enum value is parsed directly :
555+
typeSetterDict["dragModel"] = new EnumSetter(fieldInfo);
556+
continue;
552557
}
553558
else if (fieldName == "partRendererBoundsIgnore")
554559
{

0 commit comments

Comments
 (0)