Exemplo n.º 1
0
		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();
			}
		}
Exemplo n.º 2
0
		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();
			}
		}
Exemplo n.º 3
0
		public override bool RunFromInventory()
		{
			mInteractionType = PlantInteractionType.FromInventory;
			return DoSoilPlacementAndPlant();
		}