aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-09-16 22:56:08 +0100
committerJustin Clark-Casey (justincc)2013-09-16 22:56:08 +0100
commit60cf42cb8dda3931c87267c989eb7bb9abe5da2f (patch)
tree01a6726fee35e0e96ee785f1be22ca362830b287 /OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
parentTo avoid viewers (particularly on the Hypergrid) from permanently caching a U... (diff)
downloadopensim-SC_OLD-60cf42cb8dda3931c87267c989eb7bb9abe5da2f.zip
opensim-SC_OLD-60cf42cb8dda3931c87267c989eb7bb9abe5da2f.tar.gz
opensim-SC_OLD-60cf42cb8dda3931c87267c989eb7bb9abe5da2f.tar.bz2
opensim-SC_OLD-60cf42cb8dda3931c87267c989eb7bb9abe5da2f.tar.xz
Make llGetLinkPrimitiveParams() abort and return existing list of params when it encounters an invalid link number, rather than throwing an exception
Addresses http://opensimulator.org/mantis/view.php?id=6768 Thanks to talun for the patch on that commit - in the end I took a different approach that also deals with invalid PRIM_LINK_TARGET However, not yet generating the same warning on invalid PRIM_LINK_TARGET as seen on LL grid This commit also adds regression tests for some cases of llGetLinkPrimitiveParams()
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs13
1 files changed, 11 insertions, 2 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 924f4d9..bd451a5 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -8190,6 +8190,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8190 8190
8191 while (true) 8191 while (true)
8192 { 8192 {
8193// m_log.DebugFormat(
8194// "[LSL API]: GetEntityParams has {0} rules with scene entity named {1}",
8195// rules.Length, entity != null ? entity.Name : "NULL");
8196
8197 if (entity == null)
8198 return result;
8199
8193 if (entity is SceneObjectPart) 8200 if (entity is SceneObjectPart)
8194 remaining = GetPrimParams((SceneObjectPart)entity, rules, ref result); 8201 remaining = GetPrimParams((SceneObjectPart)entity, rules, ref result);
8195 else 8202 else
@@ -8400,7 +8407,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8400 while (idx < rules.Length) 8407 while (idx < rules.Length)
8401 { 8408 {
8402 int code = (int)rules.GetLSLIntegerItem(idx++); 8409 int code = (int)rules.GetLSLIntegerItem(idx++);
8403 int remain = rules.Length-idx; 8410 int remain = rules.Length - idx;
8404 8411
8405 switch (code) 8412 switch (code)
8406 { 8413 {
@@ -8777,7 +8784,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8777 )); 8784 ));
8778 break; 8785 break;
8779 case (int)ScriptBaseClass.PRIM_LINK_TARGET: 8786 case (int)ScriptBaseClass.PRIM_LINK_TARGET:
8780 if(remain < 3) 8787
8788 // TODO: Should be issuing a runtime script warning in this case.
8789 if (remain < 3)
8781 return null; 8790 return null;
8782 8791
8783 return rules.GetSublist(idx, -1); 8792 return rules.GetSublist(idx, -1);