aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs16
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 41d1342..c9ee28e 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -6515,23 +6515,27 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6515 { 6515 {
6516 for (int i = 0; i < length; i++) 6516 for (int i = 0; i < length; i++)
6517 { 6517 {
6518 int needle = llGetListEntryType(test, 0).value; 6518//// int needle = llGetListEntryType(test, 0).value;
6519 int haystack = llGetListEntryType(src, i).value; 6519//// int haystack = llGetListEntryType(src, i).value;
6520 6520
6521 // Why this piece of insanity? This is because most script constants are C# value types (e.g. int) 6521 // Why this piece of insanity? This is because most script constants are C# value types (e.g. int)
6522 // rather than wrapped LSL types. Such a script constant does not have int.Equal(LSL_Integer) code 6522 // rather than wrapped LSL types. Such a script constant does not have int.Equal(LSL_Integer) code
6523 // and so the comparison fails even if the LSL_Integer conceptually has the same value. 6523 // and so the comparison fails even if the LSL_Integer conceptually has the same value.
6524 // Therefore, here we test Equals on both the source and destination objects. 6524 // Therefore, here we test Equals on both the source and destination objects.
6525 // However, a future better approach may be use LSL struct script constants (e.g. LSL_Integer(1)). 6525 // However, a future better approach may be use LSL struct script constants (e.g. LSL_Integer(1)).
6526 if ((needle == haystack) && (src.Data[i].Equals(test.Data[0]) || test.Data[0].Equals(src.Data[i]))) 6526
6527 // The commented out bit of insanity was to check the LSL types are the same as well, which we don't really want.
6528 if (src.Data[i].Equals(test.Data[0]) || test.Data[0].Equals(src.Data[i]))
6529//// if ((needle == haystack) && (src.Data[i].Equals(test.Data[0]) || test.Data[0].Equals(src.Data[i])))
6527 { 6530 {
6528 int j; 6531 int j;
6529 for (j = 1; j < test.Length; j++) 6532 for (j = 1; j < test.Length; j++)
6533 if (!(src.Data[i+j].Equals(test.Data[j]) || test.Data[j].Equals(src.Data[i+j])))
6530 { 6534 {
6531 needle = llGetListEntryType(test, j).value; 6535//// needle = llGetListEntryType(test, j).value;
6532 haystack = llGetListEntryType(src, i+j).value; 6536//// haystack = llGetListEntryType(src, i+j).value;
6533 6537
6534 if ((needle != haystack) || (!(src.Data[i+j].Equals(test.Data[j]) || test.Data[j].Equals(src.Data[i+j])))) 6538//// if ((needle != haystack) || (!(src.Data[i+j].Equals(test.Data[j]) || test.Data[j].Equals(src.Data[i+j]))))
6535 break; 6539 break;
6536 } 6540 }
6537 6541