Reproduce a corner case behavior for llListReplaceList

avinationmerge
Melanie 2011-01-25 16:19:29 +01:00
parent aa6c097cca
commit 3c075aaf46
1 changed files with 9 additions and 6 deletions

View File

@ -9422,7 +9422,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
/// <summary> /// <summary>
/// illListReplaceList removes the sub-list defined by the inclusive indices /// llListReplaceList removes the sub-list defined by the inclusive indices
/// start and end and inserts the src list in its place. The inclusive /// start and end and inserts the src list in its place. The inclusive
/// nature of the indices means that at least one element must be deleted /// nature of the indices means that at least one element must be deleted
/// if the indices are within the bounds of the existing list. I.e. 2,2 /// if the indices are within the bounds of the existing list. I.e. 2,2
@ -9479,16 +9479,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
// based upon end. Note that if end exceeds the upper // based upon end. Note that if end exceeds the upper
// bound in this case, the entire destination list // bound in this case, the entire destination list
// is removed. // is removed.
else else if (start == 0)
{ {
if (end + 1 < dest.Length) if (end + 1 < dest.Length)
{
return src + dest.GetSublist(end + 1, -1); return src + dest.GetSublist(end + 1, -1);
}
else else
{
return src; return src;
} }
else // Start < 0
{
if (end + 1 < dest.Length)
return dest.GetSublist(end + 1, -1);
else
return new LSL_List();
} }
} }
// Finally, if start > end, we strip away a prefix and // Finally, if start > end, we strip away a prefix and