public IEnumerable <YieldResult> New_TendToFields() { Furniture furniture = InteractionTarget.GetPrimaryHolder <Furniture>(); SoilModule soilModule = furniture.GetModule <SoilModule>(); foreach (var interaction in soilModule.GetInteractions(human, InteractionInfo.issuedByAI, false)) { if (interaction.interaction == Interaction.RemoveInfestedPlants || interaction.interaction == Interaction.RemovePlant || interaction.interaction == Specialization.TendToFieldsInteraction) { continue; } if (interaction.interaction == Interaction.WaterPlant) { if (!soilModule.GetSeasons().Contains(SeasonManager.GetCurrentSeason())) { continue; } //InteractionRestrictionCanTakeResourceNearby cheat. we don't check the distance if (!WorldScripts.Instance.furnitureFactory.GetModules <InventoryReplenishmentModule>().Any(x => x.GetResource() == Resource.Water)) { continue; } //InteractionRestrictionEquipmentEffect cheat. we don't check the distance if (!human.equipmentSet.GetEffects().Any(x => x.first == EquipmentEffect.WateringPlants)) { continue; } } else if (!WorkInteractionControllerPatch.CheckInteraction(InteractionTarget, interaction, human)) { continue; } subTask = new YieldMicroInteraction(new InteractionInfo( interaction.interaction, InteractionTarget, interaction.restrictions, InteractionInfo.issuedByAI, InteractionInfo.priority, isContinuationOrSubtask: true), human); while (subTask != null) // WHILEPROTECTED { subTask = subTask.Handle(); yield return(YieldResult.WaitFrame); } StopCurrentSubtask(); } yield return(YieldResult.Completed); }