parent
7a31a85408
commit
95d6396300
|
@ -1874,6 +1874,43 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
"dataserver", resobj, new DetectParams[0]));
|
"dataserver", resobj, new DetectParams[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Similar to llDie but given an object UUID
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="objectUUID"></param>
|
||||||
|
|
||||||
|
public void osDie(LSL_Key objectUUID)
|
||||||
|
{
|
||||||
|
CheckThreatLevel(ThreatLevel.VeryHigh, "osDie");
|
||||||
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
|
UUID objUUID;
|
||||||
|
if (!UUID.TryParse(objectUUID, out objUUID)) // prior to patching, a thrown exception regarding invalid GUID format would be shouted instead.
|
||||||
|
{
|
||||||
|
OSSLShoutError("osDie() cannot delete objects with invalid UUIDs");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
DeleteObject(objUUID);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DeleteObject(UUID objUUID)
|
||||||
|
{
|
||||||
|
SceneObjectGroup sceneOG = World.GetSceneObjectGroup(objUUID);
|
||||||
|
|
||||||
|
if (sceneOG == null) // prior to patching, PostObjectEvent() would cause a throw exception to be shouted instead.
|
||||||
|
{
|
||||||
|
OSSLShoutError("osDie() cannot delete " + objUUID.ToString() + ", object was not found in scene.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sceneOG.OwnerID != m_host.OwnerID)
|
||||||
|
return;
|
||||||
|
|
||||||
|
World.DeleteSceneObject(sceneOG, false);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Write a notecard directly to the prim's inventory.
|
/// Write a notecard directly to the prim's inventory.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -316,6 +316,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void osForceBreakAllLinks();
|
void osForceBreakAllLinks();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Similar to llDie but given an object UUID
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="objectUUID"></param>
|
||||||
|
|
||||||
|
void osDie(LSL_Key objectUUID);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Check if the given key is an npc
|
/// Check if the given key is an npc
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -577,6 +577,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||||
m_OSSL_Functions.osForceBreakAllLinks();
|
m_OSSL_Functions.osForceBreakAllLinks();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void osDie(LSL_Key objectUUID)
|
||||||
|
{
|
||||||
|
m_OSSL_Functions.osDie(objectUUID);
|
||||||
|
}
|
||||||
|
|
||||||
public LSL_Integer osIsNpc(LSL_Key npc)
|
public LSL_Integer osIsNpc(LSL_Key npc)
|
||||||
{
|
{
|
||||||
return m_OSSL_Functions.osIsNpc(npc);
|
return m_OSSL_Functions.osIsNpc(npc);
|
||||||
|
|
Loading…
Reference in New Issue