diff --git a/LayoutFunctions/LayoutFunctionCommon/LayoutStrategies.cs b/LayoutFunctions/LayoutFunctionCommon/LayoutStrategies.cs index 5347bfcb..40049b75 100644 --- a/LayoutFunctions/LayoutFunctionCommon/LayoutStrategies.cs +++ b/LayoutFunctions/LayoutFunctionCommon/LayoutStrategies.cs @@ -249,7 +249,7 @@ public static HashSet StandardLayoutOnAllLevels /// Pringle-specific behavior to pick a specific config and orientation. This code only executes if the room has a `ConfigId` property, which is only set on pringle. /// - public static SpaceConfiguration LimitConfigsToId(SpaceConfiguration configs, TSpaceBoundary room, List<(RoomEdge OrientationGuideEdge, List WallCandidates)> wallCandidateOptions = null) where TSpaceBoundary : Element, ISpaceBoundary + public static SpaceConfiguration LimitConfigsToId(SpaceConfiguration originalConfigs, TSpaceBoundary room, List<(RoomEdge OrientationGuideEdge, List WallCandidates)> wallCandidateOptions = null) where TSpaceBoundary : Element, ISpaceBoundary { // If a set of wall candidate options are provided, limit to the one that aligns with the boundary's first edge. // In the future, as room shapes become more editable, we might want to pass in an explicit "orientation edge" instead of just using the first edge. @@ -266,16 +266,16 @@ public static SpaceConfiguration LimitConfigsToId(SpaceConfigura } } - // Limit the possible configs to the one specified by the room's ConfigId property. + // Limit the possible configs to the one specified by the room's ConfigId property, if it's found in the set. var configId = room.ConfigId; - var config = new SpaceConfiguration(); - if (configs.ContainsKey(configId)) + var newConfigs = new SpaceConfiguration(); + if (originalConfigs.ContainsKey(configId)) { - config.Add(configId, configs[configId]); - return config; + newConfigs.Add(configId, originalConfigs[configId]); + return newConfigs; } - return configs; + return originalConfigs; }