File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
src/kOS/Suffixed/PartModuleField Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -235,12 +235,13 @@ public virtual BooleanValue HasField(StringValue fieldName)
235235 /// <returns>a BaseField - a KSP type that can be used to get the value, or its GUI name or its reflection info.</returns>
236236 protected BaseField GetField ( string cookedGuiName )
237237 {
238- // Conceptually this should be a FirstOrDefault(), because there should only be one Field
239- // with the given GUI name. But Issue #2666 forced kOS to change it to a list of hits
238+ // Conceptually this should be a single hit using FirstOrDefault(), because there should only
239+ // be one Field with the given GUI name. But Issue #2666 forced kOS to change it to an array of hits
240240 // because KSP started naming two fields with the same gui name, only one of which is visible
241241 // at a time:
242242 BaseField [ ] allMatches = partModule . Fields . Cast < BaseField > ( ) .
243- Where ( field => string . Equals ( GetFieldName ( field ) , cookedGuiName , StringComparison . CurrentCultureIgnoreCase ) ) . ToArray < BaseField > ( ) ;
243+ Where ( field => string . Equals ( GetFieldName ( field ) , cookedGuiName , StringComparison . CurrentCultureIgnoreCase ) ) .
244+ ToArray < BaseField > ( ) ;
244245 // When KSP is *not* doing the weird thing of two fields with the same name, there's just one hit and it's simple:
245246 if ( allMatches . Count ( ) == 1 )
246247 return allMatches . First ( ) ;
You can’t perform that action at this time.
0 commit comments