private static void HistoryPatch(GameHistoryData __instance) { foreach (var proto in TotalDict[ProtoType.Recipe]) { var recipe = proto as RecipeProto; if (recipe.preTech != null) { if (__instance.TechState(recipe.preTech.ID).unlocked) { if (!__instance.RecipeUnlocked(recipe.ID)) { __instance.UnlockRecipe(recipe.ID); } } } } }
private static void GameHistoryDataPostPatch(GameHistoryData __instance) { ProtoRegister.Logger.LogInfo("GameHistoryDataPatch.Postfix invoked."); ProtoRegister.AddRecipeProtos .Where(proto => proto.preTech != null && __instance.TechState(proto.preTech.ID).unlocked&& !__instance.RecipeUnlocked(proto.ID)) .ForEach(proto => __instance.UnlockRecipe(proto.ID)); }