From ff4f2f568163e61a71f324c1e90b4d2e863839f7 Mon Sep 17 00:00:00 2001 From: Tedd Hansen Date: Mon, 31 Dec 2007 19:18:17 +0000 Subject: Changed type comparison from String to object type --- .../Compiler/Server_API/LSL_BuiltIn_Commands.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs index e6a9fe2..77f31b5 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs @@ -1654,7 +1654,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler { return new LSL_Types.Vector3(0, 0, 0); } - if (src.Data[index].GetType().ToString() == "OpenSim.Region.ScriptEngine.Common.LSL_Types+Vector3") + if (src.Data[index].GetType() == typeof(OpenSim.Region.ScriptEngine.Common.LSL_Types.Vector3)) { return (LSL_Types.Vector3)src.Data[index]; } @@ -1674,7 +1674,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler { return new LSL_Types.Quaternion(0, 0, 0, 1); } - if (src.Data[index].GetType().ToString() == "OpenSim.Region.ScriptEngine.Common.LSL_Types+Quaternion") + if (src.Data[index].GetType() == typeof(OpenSim.Region.ScriptEngine.Common.LSL_Types.Quaternion)) { return (LSL_Types.Quaternion)src.Data[index]; } @@ -1709,13 +1709,13 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler { return 0; } - switch (src.Data[index].GetType().ToString()) + switch (src.Data[index].GetType()) { - case "System.Int32": + case typeof(System.Int32): return 1; - case "System.Double": + case typeof(System.Double): return 2; - case "System.String": + case typeof(System.String): LLUUID tuuid; if (LLUUID.TryParse(src.Data[index].ToString(),out tuuid)) { @@ -1725,11 +1725,11 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler { return 4; } - case "OpenSim.Region.ScriptEngine.Common.LSL_Types+Vector3": + case typeof(OpenSim.Region.ScriptEngine.Common.LSL_Types.Vector3): return 5; - case "OpenSim.Region.ScriptEngine.Common.LSL_Types+Quaternion": + case typeof(OpenSim.Region.ScriptEngine.Common.LSL_Types.Quaternion): return 6; - case "OpenSim.Region.ScriptEngine.Common.LSL_Types+list": + case typeof(OpenSim.Region.ScriptEngine.Common.LSL_Types.list): return 7; default: return 0; -- cgit v1.1