コード例 #1
0
        public void botSitObject(string bot, string objectID, LSL_Vector offset)
        {
            if (!ScriptProtection.CheckThreatLevel(ThreatLevel.Moderate, "botTouchObject", m_host, "bot", m_itemID))
            {
                return;
            }
            IScenePresence sp = World.GetScenePresence(UUID.Parse(bot));

            if (sp == null)
            {
                return;
            }
            ISceneChildEntity child = World.GetSceneObjectPart(UUID.Parse(objectID));

            if (child == null)
            {
                throw new Exception("Failed to find entity to sit on");
            }

            sp.HandleAgentRequestSit(sp.ControllingClient, UUID.Parse(objectID),
                                     new Vector3((float)offset.x, (float)offset.y, (float)offset.z));
        }