diff options
author | onefang | 2019-07-24 01:07:48 +1000 |
---|---|---|
committer | onefang | 2019-07-24 01:07:48 +1000 |
commit | d1a1338d1a63c2992868d1b66ea5e5741e8a3971 (patch) | |
tree | 09801d7ec0836943a17ddae873341dfaf0770a9a /OpenSim/Region/ScriptEngine | |
parent | Warnings-- (diff) | |
download | opensim-SC-d1a1338d1a63c2992868d1b66ea5e5741e8a3971.zip opensim-SC-d1a1338d1a63c2992868d1b66ea5e5741e8a3971.tar.gz opensim-SC-d1a1338d1a63c2992868d1b66ea5e5741e8a3971.tar.bz2 opensim-SC-d1a1338d1a63c2992868d1b66ea5e5741e8a3971.tar.xz |
Revert list content type check.
https://sledjhamr.org/mantisbt/view.php?id=19
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 84e4546..ce2bfaf 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -5985,23 +5985,27 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5985 | { | 5985 | { |
5986 | for (int i = 0; i < length; i++) | 5986 | for (int i = 0; i < length; i++) |
5987 | { | 5987 | { |
5988 | int needle = llGetListEntryType(test, 0).value; | 5988 | //// int needle = llGetListEntryType(test, 0).value; |
5989 | int haystack = llGetListEntryType(src, i).value; | 5989 | //// int haystack = llGetListEntryType(src, i).value; |
5990 | 5990 | ||
5991 | // Why this piece of insanity? This is because most script constants are C# value types (e.g. int) | 5991 | // Why this piece of insanity? This is because most script constants are C# value types (e.g. int) |
5992 | // rather than wrapped LSL types. Such a script constant does not have int.Equal(LSL_Integer) code | 5992 | // rather than wrapped LSL types. Such a script constant does not have int.Equal(LSL_Integer) code |
5993 | // and so the comparison fails even if the LSL_Integer conceptually has the same value. | 5993 | // and so the comparison fails even if the LSL_Integer conceptually has the same value. |
5994 | // Therefore, here we test Equals on both the source and destination objects. | 5994 | // Therefore, here we test Equals on both the source and destination objects. |
5995 | // However, a future better approach may be use LSL struct script constants (e.g. LSL_Integer(1)). | 5995 | // However, a future better approach may be use LSL struct script constants (e.g. LSL_Integer(1)). |
5996 | if ((needle == haystack) && (src.Data[i].Equals(test.Data[0]) || test.Data[0].Equals(src.Data[i]))) | 5996 | |
5997 | // The commented out bit of insanity was to check the LSL types are the same as well, which we don't really want. | ||
5998 | if (src.Data[i].Equals(test.Data[0]) || test.Data[0].Equals(src.Data[i])) | ||
5999 | //// if ((needle == haystack) && (src.Data[i].Equals(test.Data[0]) || test.Data[0].Equals(src.Data[i]))) | ||
5997 | { | 6000 | { |
5998 | int j; | 6001 | int j; |
5999 | for (j = 1; j < test.Length; j++) | 6002 | for (j = 1; j < test.Length; j++) |
6003 | if (!(src.Data[i+j].Equals(test.Data[j]) || test.Data[j].Equals(src.Data[i+j]))) | ||
6000 | { | 6004 | { |
6001 | needle = llGetListEntryType(test, j).value; | 6005 | //// needle = llGetListEntryType(test, j).value; |
6002 | haystack = llGetListEntryType(src, i+j).value; | 6006 | //// haystack = llGetListEntryType(src, i+j).value; |
6003 | 6007 | ||
6004 | if ((needle != haystack) || (!(src.Data[i+j].Equals(test.Data[j]) || test.Data[j].Equals(src.Data[i+j])))) | 6008 | //// if ((needle != haystack) || (!(src.Data[i+j].Equals(test.Data[j]) || test.Data[j].Equals(src.Data[i+j])))) |
6005 | break; | 6009 | break; |
6006 | } | 6010 | } |
6007 | 6011 | ||