Ejemplo n.º 1
0
        protected override bool Run(SimDescription me, bool singleSelection)
        {
            Urnstone urnstone = Urnstones.CreateGrave(me, false);

            if (urnstone == null)
            {
                return(false);
            }

            if ((urnstone.InInventory) || (!urnstone.InWorld))
            {
                if (urnstone.InInventory)
                {
                    Inventory inventory = Inventories.ParentInventory(urnstone);
                    if ((inventory != null) && (inventory.Owner == me.CreatedSim))
                    {
                        Camera.FocusOnGivenPosition(me.CreatedSim.Position, 6f);
                        return(false);
                    }

                    if (!AcceptCancelDialog.Show(Common.Localize("FindGrave:Prompt")))
                    {
                        return(false);
                    }
                }

                bool bOriginalValue = mActor.Inventory.IgnoreInventoryValidation;
                mActor.Inventory.IgnoreInventoryValidation = true;

                try
                {
                    mActor.Inventory.TryToMove(urnstone);
                }
                finally
                {
                    mActor.Inventory.IgnoreInventoryValidation = bOriginalValue;
                }
            }
            else
            {
                urnstone.FadeIn();

                Camera.FocusOnGivenPosition(urnstone.Position, 6f);
            }

            return(true);
        }