mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 17:05:55 +08:00
add llDerezObject(..)
This commit is contained in:
@@ -18762,6 +18762,37 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public LSL_Integer llDerezObject(LSL_Key objectUUID, LSL_Integer flag)
|
||||
{
|
||||
if (!UUID.TryParse(objectUUID, out UUID objUUID))
|
||||
return new LSL_Integer(0);
|
||||
|
||||
if (objUUID.IsZero())
|
||||
return new LSL_Integer(0);
|
||||
|
||||
SceneObjectGroup sceneOG = World.GetSceneObjectGroup(objUUID);
|
||||
|
||||
if (sceneOG is null || sceneOG.IsDeleted || sceneOG.IsAttachment)
|
||||
return new LSL_Integer(0);
|
||||
|
||||
if (sceneOG.OwnerID.NotEqual(m_host.OwnerID))
|
||||
return new LSL_Integer(0);
|
||||
|
||||
// restrict to objects rezzed by host
|
||||
if (sceneOG.RezzerID.NotEqual(m_host.ParentGroup.UUID))
|
||||
return new LSL_Integer(0);
|
||||
|
||||
if (sceneOG.UUID.Equals(m_host.ParentGroup.UUID))
|
||||
return new LSL_Integer(0);
|
||||
|
||||
if (flag.value == 0)
|
||||
World.DeleteSceneObject(sceneOG, false);
|
||||
else
|
||||
sceneOG.RootPart.AddFlag(PrimFlags.TemporaryOnRez);
|
||||
|
||||
return new LSL_Integer(1);
|
||||
}
|
||||
}
|
||||
|
||||
public class NotecardCache
|
||||
|
||||
@@ -521,5 +521,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||
LSL_Integer llLinksetDataWriteProtected(LSL_String name, LSL_String value, LSL_String pass);
|
||||
|
||||
LSL_Integer llIsFriend(LSL_Key agent_id);
|
||||
LSL_Integer llDerezObject(LSL_Key objectUUID, LSL_Integer flag);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2796,11 +2796,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
{
|
||||
return m_LSL_Functions.llLinksetDataFindKeys(pattern, start, count);
|
||||
}
|
||||
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public LSL_Integer llIsFriend(LSL_Key agent_id)
|
||||
{
|
||||
return m_LSL_Functions.llIsFriend(agent_id);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public LSL_Integer llDerezObject(LSL_Key objectUUID, LSL_Integer flag)
|
||||
{
|
||||
return m_LSL_Functions.llDerezObject(objectUUID, flag);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user