aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs8
1 files changed, 7 insertions, 1 deletions
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
78 config.AddConfig("LL-Functions"); 78 config.AddConfig("LL-Functions");
79 79
80 m_delayFactor = config.Configs["LL-Functions"].GetFloat("ScriptDelayFactor", 1.0f); 80 m_delayFactor = config.Configs["LL-Functions"].GetFloat("ScriptDelayFactor", 1.0f);
81 m_distanceFactor = config.Configs["LL-Functions"].GetFloat("ScriptDistanceLimitFactor", 1.0f);
81 82
82 } 83 }
83 84
@@ -85,6 +86,7 @@ namespace OpenSim.Region.ScriptEngine.Common
85 private string m_state = "default"; 86 private string m_state = "default";
86 private bool m_waitingForScriptAnswer=false; 87 private bool m_waitingForScriptAnswer=false;
87 private float m_delayFactor = 1.0f; 88 private float m_delayFactor = 1.0f;
89 private float m_distanceFactor = 1.0f;
88 90
89 91
90 private void ScriptSleep(int delay) 92 private void ScriptSleep(int delay)
@@ -1658,7 +1660,7 @@ namespace OpenSim.Region.ScriptEngine.Common
1658 LSL_Types.Vector3 currentPos = llGetLocalPos(); 1660 LSL_Types.Vector3 currentPos = llGetLocalPos();
1659 if (llVecDist(currentPos, targetPos) > 10) 1661 if (llVecDist(currentPos, targetPos) > 10)
1660 { 1662 {
1661 targetPos = currentPos + 10 * llVecNorm(targetPos - currentPos); 1663 targetPos = currentPos + m_distanceFactor * 10.0f * llVecNorm(targetPos - currentPos);
1662 } 1664 }
1663 1665
1664 if (part.ParentID != 0) 1666 if (part.ParentID != 0)
@@ -2293,6 +2295,10 @@ namespace OpenSim.Region.ScriptEngine.Common
2293 m_host.AddScriptLPS(1); 2295 m_host.AddScriptLPS(1);
2294 bool found = false; 2296 bool found = false;
2295 2297
2298 float dist = (float)llVecDist(llGetPos(), pos);
2299 if(dist > m_distanceFactor * 10.0f)
2300 return;
2301
2296 // Instead of using return;, I'm using continue; because in our TaskInventory implementation 2302 // Instead of using return;, I'm using continue; because in our TaskInventory implementation
2297 // it's possible to have two items with the same task inventory name. 2303 // it's possible to have two items with the same task inventory name.
2298 // this is an easter egg of sorts. 2304 // this is an easter egg of sorts.