public static void CleanupPlantInstances(PlantableObjectData data, Sim sim, PlantInteractionType plantInteractionType) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) if (data.Soil != null) { Plant plant = data.Soil.GetContainedObject(Soil.ContainmentSlots.Plant) as Plant; if (plant != null) { plant.RemoveFromUseList(sim); data.Soil.RemoveFromUseList(sim); if (data.Soil.IsGhosted()) { data.Soil.UnGhost(); } return; } } if (data.PlantableObject != null) { EWPetPlantSeed.UnreservePlantablePlantingFailed(data.PlantableObject, sim, plantInteractionType); } if (data.Soil != null) { data.Soil.Destroy(); } }
public static void UnreservePlantablePlantingFailed(IGameObject currentTarget, Sim sim, PlantInteractionType interactionType) { currentTarget.RemoveFromUseList(sim); if (interactionType == PlantInteractionType.FromInventory || interactionType == PlantInteractionType.FromInventoryPlantMany) { if (!sim.Inventory.SetNotInUse(currentTarget)) { currentTarget.Destroy(); } return; } currentTarget.SetOpacity(1f, 0f); Ingredient ingredient = currentTarget as Ingredient; if (ingredient != null) { ingredient.EnableFootprint(); } else { (currentTarget as PlantableNonIngredient)?.EnableFootprint(); } }
public override bool RunFromInventory() { mInteractionType = PlantInteractionType.FromInventory; return DoSoilPlacementAndPlant(); }