From 61f23fa045b5df6110a5553042af2a23ddb160a2 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Tue, 22 Apr 2008 10:11:29 +0000 Subject: * Implements llScriptDanger * Made the scene's scriptDanger method more generic so both the llScriptDanger method and the Script engine method use the same private method. --- OpenSim/Region/Environment/Scenes/Scene.cs | 35 +++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes/Scene.cs') diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 32a2deb..fd729d6 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 -- cgit v1.1