From 9b696a1d5c92594fb3f220b9348a739b7cce8d6d Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Tue, 22 Apr 2008 08:15:44 +0000 Subject: * Patch from Mic Bowman(cmickeyb) that implements llUnsit. Thanks Mic! * I expanded upon his patch just a bit to incorporate the following. * if the avatar is sitting on this object, then we can unsit them. * If the object owner also owns the parcel or if the land is group owned and the object is group owned by the same group or if the object is owned by a person with estate access, then we can unsit them. --- .../ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 39 +++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs') diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 04f8967..fb436c7 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs @@ -3284,7 +3284,44 @@ namespace OpenSim.Region.ScriptEngine.Common public void llUnSit(string id) { m_host.AddScriptLPS(1); - NotImplemented("llUnSit"); + + LLUUID key = new LLUUID(); + if (LLUUID.TryParse(id, out key)) + { + + ScenePresence av = World.GetScenePresence(key); + if (av != null) + { + if (llAvatarOnSitTarget() == id) + { + // if the avatar is sitting on this object, then + // we can unsit them. We don't want random scripts unsitting random people + // Lets avoid the popcorn avatar scenario. + av.StandUp(); + } + else + { + // If the object owner also owns the parcel + // or + // if the land is group owned and the object is group owned by the same group + // or + // if the object is owned by a person with estate access. + + ILandObject parcel = World.LandChannel.getLandObject(av.AbsolutePosition.X, av.AbsolutePosition.Y); + if (parcel != null) + { + if (m_host.ObjectOwner == parcel.landData.ownerID || + (m_host.OwnerID == m_host.GroupID && m_host.GroupID == parcel.landData.groupID + && parcel.landData.isGroupOwned) || World.PermissionsMngr.GenericEstatePermission(m_host.OwnerID)) + { + av.StandUp(); + } + } + } + } + + } + } public LSL_Types.Vector3 llGroundSlope(LSL_Types.Vector3 offset) -- cgit v1.1