From 1ac6bb3107228e669c0e95dc41166ad369cf752e Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Wed, 27 Aug 2008 17:12:55 +0000 Subject: Add ScriptDistanceLimitFactor to OpenSim.ini to allow modifcation of LSL's arbitrary 10 m limit on object movement. Also implements the 10 m maximum rezzing distance, subhect to the same factor. --- OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 60ed5c1..74ba4fa 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs @@ -78,6 +78,7 @@ namespace OpenSim.Region.ScriptEngine.Common config.AddConfig("LL-Functions"); m_delayFactor = config.Configs["LL-Functions"].GetFloat("ScriptDelayFactor", 1.0f); + m_distanceFactor = config.Configs["LL-Functions"].GetFloat("ScriptDistanceLimitFactor", 1.0f); } @@ -85,6 +86,7 @@ namespace OpenSim.Region.ScriptEngine.Common private string m_state = "default"; private bool m_waitingForScriptAnswer=false; private float m_delayFactor = 1.0f; + private float m_distanceFactor = 1.0f; private void ScriptSleep(int delay) @@ -1658,7 +1660,7 @@ namespace OpenSim.Region.ScriptEngine.Common LSL_Types.Vector3 currentPos = llGetLocalPos(); if (llVecDist(currentPos, targetPos) > 10) { - targetPos = currentPos + 10 * llVecNorm(targetPos - currentPos); + targetPos = currentPos + m_distanceFactor * 10.0f * llVecNorm(targetPos - currentPos); } if (part.ParentID != 0) @@ -2293,6 +2295,10 @@ namespace OpenSim.Region.ScriptEngine.Common m_host.AddScriptLPS(1); bool found = false; + float dist = (float)llVecDist(llGetPos(), pos); + if(dist > m_distanceFactor * 10.0f) + return; + // Instead of using return;, I'm using continue; because in our TaskInventory implementation // it's possible to have two items with the same task inventory name. // this is an easter egg of sorts. -- cgit v1.1