diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 9d055265d7..e1a4648978 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs @@ -3541,6 +3541,11 @@ namespace OpenSim.Region.ScriptEngine.Common public LSL_Types.list llListSort(LSL_Types.list src, int stride, int ascending) { m_host.AddScriptLPS(1); + + if (stride <= 0) + { + stride = 1; + } return src.Sort(stride, ascending); } @@ -3855,8 +3860,10 @@ namespace OpenSim.Region.ScriptEngine.Common m_host.AddScriptLPS(1); - if (stride == 0) + if (stride <= 0) + { stride = 1; + } // Stride MUST be a factor of the list length // If not, then return the src list. This also diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index e0614daeea..6c4f34a119 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -3454,6 +3454,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Types.list llListSort(LSL_Types.list src, int stride, int ascending) { m_host.AddScriptLPS(1); + + if (stride <= 0) + { + stride = 1; + } return src.Sort(stride, ascending); } @@ -3766,8 +3771,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.AddScriptLPS(1); - if (stride == 0) + if (stride <= 0) + { stride = 1; + } // Stride MUST be a factor of the list length // If not, then return the src list. This also