Thanks, krtaylor, for a patch that fixes llListSort() and llListRandomize() failing with stride less than 1. Fix issue 1893.

0.6.0-stable
Mike Mazur 2008-08-15 00:55:16 +00:00
parent 4041194db9
commit 60acc370fc
2 changed files with 16 additions and 2 deletions

View File

@ -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

View File

@ -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