From f46fc508d18d925d09d64fa7d863c3b1fe7a66a0 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Tue, 16 Sep 2008 10:26:54 +0000 Subject: [PATCH] Mantis #1843 Applying DotNetEnine part of this patch. Thank you, nlin! Corrects ad hoc key list comparison. --- .../ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 5d6cd37dfa..44033c1b04 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs @@ -4385,11 +4385,11 @@ namespace OpenSim.Region.ScriptEngine.Common { for (int i = 0; i < length; i++) { - if (src.Data[i].Equals(test.Data[0])) + if (AreEqual(src.Data[i], test.Data[0])) { int j; for (j = 1; j < test.Length; j++) - if (!src.Data[i+j].Equals(test.Data[j])) + if (!AreEqual(src.Data[i+j], test.Data[j])) break; if (j == test.Length) { @@ -4404,6 +4404,18 @@ namespace OpenSim.Region.ScriptEngine.Common } + private bool AreEqual(object src, object test) + { + if (src.GetType().FullName == "System.String") + { + return src.ToString() == test.ToString(); + } + else + { + return src.Equals(test); + } + } + public string llGetObjectName() { m_host.AddScriptLPS(1);