Skip to content

Commit

Permalink
Fix bug with critter feeder
Browse files Browse the repository at this point in the history
  • Loading branch information
daviscook477 committed Jan 9, 2020
1 parent 899776c commit a860405
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/RollerSnake/RollerSnakePatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,23 @@ public static void Postfix(ref Immigration __instance)
}
}

[HarmonyPatch(typeof(CreatureFeederConfig))]
[HarmonyPatch(nameof(CreatureFeederConfig.ConfigurePost))]
public static class CreatureFeederConfig_ConfigurePost_Patch
{
public static void Postfix(BuildingDef def)
{
List<Tag> tagList = def.BuildingComplete.GetComponent<Storage>().storageFilters;
Tag[] target_species = new Tag[1]
{
BaseRollerSnakeConfig.SpeciesId
};
foreach (KeyValuePair<Tag, Diet> collectDiet in DietManager.CollectDiets(target_species))
tagList.Add(collectDiet.Key);
def.BuildingComplete.GetComponent<Storage>().storageFilters = tagList;
}
}

[HarmonyPatch(typeof(CodexEntryGenerator), "GenerateCreatureEntries")]
public class CodexEntryGenerator_GenerateCreatureEntries_Patch
{
Expand Down

0 comments on commit a860405

Please sign in to comment.