private static void Postfix(Pawn pawn, IntVec3 c, ref bool __result) { if (__result) { ThingDef plant = c.GetPlant(map: pawn.Map).def; __result = RaceAddonTools.CheckPlant(pawn.def, plant); } }
private static void Postfix(IPlantToGrowSettable settable, Pawn pawn, ref bool __result) { if (__result) { ThingDef plant = WorkGiver_Grower.CalculateWantedPlantDef((settable as Zone_Growing)?.Cells[0] ?? ((Thing)settable).Position, pawn.Map); __result = RaceAddonTools.CheckPlant(pawn.def, plant); } }
private static FloatMenuOption Check(FloatMenuOption menu, ThingDef plantDef) { if (!PawnsFinder.AllMaps_FreeColonistsSpawned.Any((Pawn x) => RaceAddonTools.CheckPlant(x.def, plantDef))) { menu.Label = plantDef.LabelCap + " (" + "RaceAddonRestriction_FloatMenu".Translate() + ")"; menu.Disabled = true; } return(menu); }