Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [HarmonyPatch(typeof(Thing))]
- [HarmonyPatch("IngestibleNow", PropertyMethod.Getter)]
- [HarmonyPatch(new Type[] { typeof(bool) })]
- public class ThingIngestibleNow_Patch
- {
- static void Postfix(Thing __instance, bool value)
- {
- if (value)
- {
- if (__instance is Plant)
- {
- var i = __instance as Plant;
- Log.Message("check: " + __instance.ToString() + " growth: " + i.Growth.ToString() + " hag: " + i.def.plant.harvestAfterGrowth.ToString());
- value = i.def.plant?.harvestAfterGrowth != null && i.Growth > i.def.plant.harvestAfterGrowth;
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment