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()
This commit is contained in:
Justin Clark-Casey (justincc)
2013-09-16 22:56:08 +01:00
parent 3f0fa9f707
commit 60cf42cb8d
3 changed files with 397 additions and 239 deletions

View File

@@ -8190,6 +8190,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
while (true)
{
// m_log.DebugFormat(
// "[LSL API]: GetEntityParams has {0} rules with scene entity named {1}",
// rules.Length, entity != null ? entity.Name : "NULL");
if (entity == null)
return result;
if (entity is SceneObjectPart)
remaining = GetPrimParams((SceneObjectPart)entity, rules, ref result);
else
@@ -8400,7 +8407,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
while (idx < rules.Length)
{
int code = (int)rules.GetLSLIntegerItem(idx++);
int remain = rules.Length-idx;
int remain = rules.Length - idx;
switch (code)
{
@@ -8777,7 +8784,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
));
break;
case (int)ScriptBaseClass.PRIM_LINK_TARGET:
if(remain < 3)
// TODO: Should be issuing a runtime script warning in this case.
if (remain < 3)
return null;
return rules.GetSublist(idx, -1);