mantis 9080: make osDie only work on object rezzed by script linkset, as spec

This commit is contained in:
UbitUmarov
2023-06-02 23:01:01 +01:00
parent 8b6b00d597
commit f8d1e78e8a

View File

@@ -2150,10 +2150,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void osDie(LSL_Key objectUUID)
{
// CheckThreatLevel(ThreatLevel.VeryHigh, "osDie");
// if this is restricted to objects rezzed by this host level can be reduced
CheckThreatLevel(ThreatLevel.Low, "osDie");
//CheckThreatLevel(ThreatLevel.Low, "osDie");
if (!UUID.TryParse(objectUUID, out UUID objUUID))
{
@@ -2161,36 +2158,24 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return;
}
InitLSL();
// harakiri check
if(objUUID.IsZero())
{
if (!m_host.ParentGroup.IsAttachment)
m_LSL_Api.llDie();
return;
}
SceneObjectGroup sceneOG = World.GetSceneObjectGroup(objUUID);
if (sceneOG == null || sceneOG.IsDeleted)
if (sceneOG is null || sceneOG.IsDeleted || sceneOG.IsAttachment)
return;
if(sceneOG.IsAttachment)
if (sceneOG.OwnerID.NotEqual(m_host.OwnerID))
return;
if (sceneOG.OwnerID != m_host.OwnerID)
return;
// harakiri check
if(sceneOG.UUID.Equals(m_host.ParentGroup.UUID))
{
m_LSL_Api.llDie();
return;
}
// restrict to objects rezzed by host
if(sceneOG.RezzerID.Equals(m_host.ParentGroup.UUID))
World.DeleteSceneObject(sceneOG, false);
{
// harakiri check should be true alwaya
if (sceneOG.UUID.NotEqual(m_host.ParentGroup.UUID))
World.DeleteSceneObject(sceneOG, false);
}
}
/// <summary>