From 3c075aaf46a9e8b9f601b664ae277ffa12ac3e0f Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 25 Jan 2011 16:19:29 +0100 Subject: Reproduce a corner case behavior for llListReplaceList --- .../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 805b344..dffc0bd 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -9422,7 +9422,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } /// - /// 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 /// 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 @@ -9479,16 +9479,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // based upon end. Note that if end exceeds the upper // bound in this case, the entire destination list // is removed. - else + else if (start == 0) { if (end + 1 < dest.Length) - { return src + dest.GetSublist(end + 1, -1); - } else - { 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 -- cgit v1.1