diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 32a2debf0a..fd729d6ac3 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -2771,13 +2771,11 @@ namespace OpenSim.Region.Environment.Scenes m_eventManager.TriggerOnScriptChangedEvent(localID, change); } - public bool pipeEventsForScript(uint localID) + private bool scriptDanger(SceneObjectPart part,LLVector3 pos) { - SceneObjectPart part = GetSceneObjectPart(localID); + ILandObject parcel = LandChannel.getLandObject(pos.X, pos.Y); if (part != null) { - LLVector3 pos = part.GetWorldPosition(); - ILandObject parcel = LandChannel.getLandObject(pos.X, pos.Y); if (parcel != null) { if ((parcel.landData.landFlags & (uint)Parcel.ParcelFlags.AllowOtherScripts) != 0) @@ -2809,7 +2807,7 @@ namespace OpenSim.Region.Environment.Scenes } else { - + if (pos.X > 0f && pos.X < Constants.RegionSize && pos.Y > 0f && pos.Y < Constants.RegionSize) { // The only time parcel != null when an object is inside a region is when @@ -2822,6 +2820,33 @@ namespace OpenSim.Region.Environment.Scenes return false; } } + } + else + { + return false; + } + } + public bool scriptDanger(uint localID, LLVector3 pos) + { + SceneObjectPart part = GetSceneObjectPart(localID); + if (part != null) + { + return scriptDanger(part, pos); + } + else + { + return false; + } + } + + public bool pipeEventsForScript(uint localID) + { + + SceneObjectPart part = GetSceneObjectPart(localID); + if (part != null) + { + LLVector3 pos = part.GetWorldPosition(); + return scriptDanger(part, pos); } else diff --git a/OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs b/OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs index 5d33294e8b..7f412519ee 100644 --- a/OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs +++ b/OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs @@ -1421,9 +1421,9 @@ namespace OpenSim.Region.ScriptEngine.Common return m_LSL_Functions.llDumpList2String(src, seperator); } - public void llScriptDanger(LSL_Types.Vector3 pos) + public int llScriptDanger(LSL_Types.Vector3 pos) { - m_LSL_Functions.llScriptDanger(pos); + return m_LSL_Functions.llScriptDanger(pos); } public void llDialog(string avatar, string message, LSL_Types.list buttons, int chat_channel) diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index fb436c7864..41c395691c 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs @@ -3693,10 +3693,19 @@ namespace OpenSim.Region.ScriptEngine.Common return ret; } - public void llScriptDanger(LSL_Types.Vector3 pos) + public int llScriptDanger(LSL_Types.Vector3 pos) { m_host.AddScriptLPS(1); - NotImplemented("llScriptDanger"); + bool result = World.scriptDanger(m_host.LocalId, new LLVector3((float)pos.x, (float)pos.y, (float)pos.z)); + if (result) + { + return 1; + } + else + { + return 0; + } + } public void llDialog(string avatar, string message, LSL_Types.list buttons, int chat_channel) diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs index fa957bb194..a74340b5aa 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs @@ -473,7 +473,7 @@ namespace OpenSim.Region.ScriptEngine.Common // string llDumpList2String(LSL_Types.list src, string seperator); //wiki: integer llScriptDanger(vector pos) - void llScriptDanger(LSL_Types.Vector3 pos); + int llScriptDanger(LSL_Types.Vector3 pos); //wiki: llDialog( key avatar, string message, list buttons, integer chat_channel ) void llDialog(string avatar, string message, LSL_Types.list buttons, int chat_channel); //wiki: llVolumeDetect(integer detect)