diff options
author | Melanie | 2012-03-05 11:54:06 +0100 |
---|---|---|
committer | Melanie | 2012-03-05 11:54:06 +0100 |
commit | 97f0cff3885e00e7e56a6c7a5c59086d241c1f2e (patch) | |
tree | 7cbeef85e0f219ff5f5ef90a128cd3f4a1212a09 /OpenSim/Region | |
parent | SL compatibility - return only points on segemtn, not ray in llCastRay (diff) | |
download | opensim-SC_OLD-97f0cff3885e00e7e56a6c7a5c59086d241c1f2e.zip opensim-SC_OLD-97f0cff3885e00e7e56a6c7a5c59086d241c1f2e.tar.gz opensim-SC_OLD-97f0cff3885e00e7e56a6c7a5c59086d241c1f2e.tar.bz2 opensim-SC_OLD-97f0cff3885e00e7e56a6c7a5c59086d241c1f2e.tar.xz |
llListSort SL compatibility: When sorting strided list and the list
length is not a multiple of the stride, return the original list.
Also, enforce that sort is ascending only when the ascending
parameter is 1, and not when it is != 0
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index 9e6752c..8adf4c5 100644 --- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | |||
@@ -858,7 +858,7 @@ namespace OpenSim.Region.ScriptEngine.Shared | |||
858 | ret = Math.Sign(Quaternion.Mag(l) - Quaternion.Mag(r)); | 858 | ret = Math.Sign(Quaternion.Mag(l) - Quaternion.Mag(r)); |
859 | } | 859 | } |
860 | 860 | ||
861 | if (ascending == 0) | 861 | if (ascending != 1) |
862 | { | 862 | { |
863 | ret = 0 - ret; | 863 | ret = 0 - ret; |
864 | } | 864 | } |
@@ -891,6 +891,9 @@ namespace OpenSim.Region.ScriptEngine.Shared | |||
891 | stride = 1; | 891 | stride = 1; |
892 | } | 892 | } |
893 | 893 | ||
894 | if ((Data.Length % stride) != 0) | ||
895 | return new list(ret); | ||
896 | |||
894 | // we can optimize here in the case where stride == 1 and the list | 897 | // we can optimize here in the case where stride == 1 and the list |
895 | // consists of homogeneous types | 898 | // consists of homogeneous types |
896 | 899 | ||
@@ -910,7 +913,7 @@ namespace OpenSim.Region.ScriptEngine.Shared | |||
910 | if (homogeneous) | 913 | if (homogeneous) |
911 | { | 914 | { |
912 | Array.Sort(ret, new HomogeneousComparer()); | 915 | Array.Sort(ret, new HomogeneousComparer()); |
913 | if (ascending == 0) | 916 | if (ascending != 1) |
914 | { | 917 | { |
915 | Array.Reverse(ret); | 918 | Array.Reverse(ret); |
916 | } | 919 | } |