Changed type comparison from String to object type

afrisby
Tedd Hansen 2007-12-31 19:18:17 +00:00
parent 5ef1433e95
commit ff4f2f5681
1 changed files with 9 additions and 9 deletions

View File

@ -1654,7 +1654,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler
{ {
return new LSL_Types.Vector3(0, 0, 0); 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]; 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); 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]; return (LSL_Types.Quaternion)src.Data[index];
} }
@ -1709,13 +1709,13 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler
{ {
return 0; return 0;
} }
switch (src.Data[index].GetType().ToString()) switch (src.Data[index].GetType())
{ {
case "System.Int32": case typeof(System.Int32):
return 1; return 1;
case "System.Double": case typeof(System.Double):
return 2; return 2;
case "System.String": case typeof(System.String):
LLUUID tuuid; LLUUID tuuid;
if (LLUUID.TryParse(src.Data[index].ToString(),out tuuid)) if (LLUUID.TryParse(src.Data[index].ToString(),out tuuid))
{ {
@ -1725,11 +1725,11 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler
{ {
return 4; return 4;
} }
case "OpenSim.Region.ScriptEngine.Common.LSL_Types+Vector3": case typeof(OpenSim.Region.ScriptEngine.Common.LSL_Types.Vector3):
return 5; return 5;
case "OpenSim.Region.ScriptEngine.Common.LSL_Types+Quaternion": case typeof(OpenSim.Region.ScriptEngine.Common.LSL_Types.Quaternion):
return 6; return 6;
case "OpenSim.Region.ScriptEngine.Common.LSL_Types+list": case typeof(OpenSim.Region.ScriptEngine.Common.LSL_Types.list):
return 7; return 7;
default: default:
return 0; return 0;