Skip to content

Commit

Permalink
Fix preset selection warning when user loads a graph.
Browse files Browse the repository at this point in the history
When a user loads a graph, Foreman would look for matching presets but
fail to find a match because it did not load in the `water_resources`
which resulted in it failing to notice things like water.

We now do this by concatenating it onto the `resources` enumerable.

Fixes #108
  • Loading branch information
Olipro committed Nov 7, 2024
1 parent 25bfa87 commit 1712072
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Foreman/DataCache/PresetProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ private static async Task<PresetErrorPackage> TestPresetStreamlined(Preset prese
}

//have to process mining, generators and boilers (since we convert them to recipes as well)
foreach (var objJToken in jsonData["resources"])
foreach (var objJToken in jsonData["resources"].Concat(jsonData["water_resources"]))
{
if (objJToken["products"].Count() == 0)
continue;
Expand Down

0 comments on commit 1712072

Please sign in to comment.