예제 #1
0
        protected override bool PrePerform(PicnicTable obj, bool postLoad)
        {
            bool repair = false;

            if (obj.SeatingGroup != null)
            {
                if (obj.mInsideSeats == null)
                {
                    repair = true;
                }
                else
                {
                    foreach (PartData seat in obj.mInsideSeats)
                    {
                        if (seat == null)
                        {
                            repair = true;
                            break;
                        }
                    }
                }
            }

            if (repair)
            {
                obj.OnCreation();

                LogCorrection("Picnic Table Seats Repaired: " + ErrorTrap.GetName(obj));
            }

            return(true);
        }
예제 #2
0
        public static void MergePlantSeed(HarvestPlant plant, Ingredient ingredient)
        {
            plant.Seed = ingredient;

            plant.PlantDef      = PlantHelper.GetPlantDefinition(plant.Seed);
            plant.mQualityLevel = ingredient.Plantable.QualityLevel;

            plant.SetGrowthState(plant.GrowthState);

            sMergedPlants.Add(plant);

            ErrorTrap.LogCorrection("Plant Seed Merged: " + ErrorTrap.GetName(plant));
        }
예제 #3
0
        protected override bool PrePerform(GameObject obj, bool postLoad)
        {
            if (obj.InInventory)
            {
                Inventory inventory = Inventory.ParentInventory(obj);
                if (inventory != null)
                {
                    if (inventory.Owner == null)
                    {
                        ErrorTrap.AddToBeDeleted(obj, true);

                        LogCorrection("Corrupt Inventory Object Deleted: " + ErrorTrap.GetName(obj));
                    }
                }
            }

            if (obj.Inventory != null)
            {
                Inventories.CheckInventory(LogCorrection, DebugLogCorrection, ErrorTrap.GetName(obj), obj.Inventory, false);
            }

            ObjectComponents.Cleanup(obj, DebugLogCorrection);
            return(true);
        }