diff options
author | Mike Mazur | 2008-08-15 00:55:16 +0000 |
---|---|---|
committer | Mike Mazur | 2008-08-15 00:55:16 +0000 |
commit | 60acc370fcd98d8553fa19c5c866727d9fac25c7 (patch) | |
tree | 828be8829bb9255348477a94b47fa8ee1b93f6e6 /OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |
parent | Refactor: Make the tree creation function take a UUID for the owner (diff) | |
download | opensim-SC-60acc370fcd98d8553fa19c5c866727d9fac25c7.zip opensim-SC-60acc370fcd98d8553fa19c5c866727d9fac25c7.tar.gz opensim-SC-60acc370fcd98d8553fa19c5c866727d9fac25c7.tar.bz2 opensim-SC-60acc370fcd98d8553fa19c5c866727d9fac25c7.tar.xz |
Thanks, krtaylor, for a patch that fixes llListSort() and llListRandomize() failing with stride less than 1. Fix issue 1893.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index e0614da..6c4f34a 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 | |||
3454 | public LSL_Types.list llListSort(LSL_Types.list src, int stride, int ascending) | 3454 | public LSL_Types.list llListSort(LSL_Types.list src, int stride, int ascending) |
3455 | { | 3455 | { |
3456 | m_host.AddScriptLPS(1); | 3456 | m_host.AddScriptLPS(1); |
3457 | |||
3458 | if (stride <= 0) | ||
3459 | { | ||
3460 | stride = 1; | ||
3461 | } | ||
3457 | return src.Sort(stride, ascending); | 3462 | return src.Sort(stride, ascending); |
3458 | } | 3463 | } |
3459 | 3464 | ||
@@ -3766,8 +3771,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3766 | 3771 | ||
3767 | m_host.AddScriptLPS(1); | 3772 | m_host.AddScriptLPS(1); |
3768 | 3773 | ||
3769 | if (stride == 0) | 3774 | if (stride <= 0) |
3775 | { | ||
3770 | stride = 1; | 3776 | stride = 1; |
3777 | } | ||
3771 | 3778 | ||
3772 | // Stride MUST be a factor of the list length | 3779 | // Stride MUST be a factor of the list length |
3773 | // If not, then return the src list. This also | 3780 | // If not, then return the src list. This also |