add llDerezObject(..)

This commit is contained in:
UbitUmarov
2024-06-23 21:54:46 +01:00
parent 583cc04910
commit cc1227364c
3 changed files with 39 additions and 1 deletions

View File

@@ -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

View File

@@ -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);
}
}

View File

@@ -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);
}
}
}