Guest User

Untitled

a guest
Feb 22nd, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. [HarmonyPatch(typeof(Thing))]
  2. [HarmonyPatch("IngestibleNow", PropertyMethod.Getter)]
  3. [HarmonyPatch(new Type[] { typeof(bool) })]
  4. public class ThingIngestibleNow_Patch
  5. {
  6. static void Postfix(Thing __instance, bool value)
  7. {
  8. if (value)
  9. {
  10. if (__instance is Plant)
  11. {
  12. var i = __instance as Plant;
  13. Log.Message("check: " + __instance.ToString() + " growth: " + i.Growth.ToString() + " hag: " + i.def.plant.harvestAfterGrowth.ToString());
  14. value = i.def.plant?.harvestAfterGrowth != null && i.Growth > i.def.plant.harvestAfterGrowth;
  15. }
  16. }
  17. }
  18. }
Add Comment
Please, Sign In to add comment