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/Common/LSL_BuiltIn_Commands.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/Common/LSL_BuiltIn_Commands.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 9d05526..e1a4648 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 | |||
3541 | public LSL_Types.list llListSort(LSL_Types.list src, int stride, int ascending) | 3541 | public LSL_Types.list llListSort(LSL_Types.list src, int stride, int ascending) |
3542 | { | 3542 | { |
3543 | m_host.AddScriptLPS(1); | 3543 | m_host.AddScriptLPS(1); |
3544 | |||
3545 | if (stride <= 0) | ||
3546 | { | ||
3547 | stride = 1; | ||
3548 | } | ||
3544 | return src.Sort(stride, ascending); | 3549 | return src.Sort(stride, ascending); |
3545 | } | 3550 | } |
3546 | 3551 | ||
@@ -3855,8 +3860,10 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
3855 | 3860 | ||
3856 | m_host.AddScriptLPS(1); | 3861 | m_host.AddScriptLPS(1); |
3857 | 3862 | ||
3858 | if (stride == 0) | 3863 | if (stride <= 0) |
3864 | { | ||
3859 | stride = 1; | 3865 | stride = 1; |
3866 | } | ||
3860 | 3867 | ||
3861 | // Stride MUST be a factor of the list length | 3868 | // Stride MUST be a factor of the list length |
3862 | // If not, then return the src list. This also | 3869 | // If not, then return the src list. This also |