mirror of
https://github.com/opensim/opensim.git
synced 2026-07-31 13:55:35 +08:00
Thanks, krtaylor, for a patch that fixes llListSort() and llListRandomize() failing with stride less than 1. Fix issue 1893.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user