From 0b92ff4fde2a4266f200e38539d7e4530b7d4909 Mon Sep 17 00:00:00 2001 From: Mike Mazur Date: Fri, 18 Jul 2008 02:05:20 +0000 Subject: Treat LSL_Types as special cases in llList2Integer and llList2Float. This could be implemented many other places, but let's do that on a case-by-case basis. --- .../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index e7313e1..7f24f0e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -3363,6 +3363,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } try { + if (src.Data[index] is LSL_Types.LSLInteger) + return Convert.ToInt32(((LSL_Types.LSLInteger) src.Data[index]).value); + else if (src.Data[index] is LSL_Types.LSLFloat) + return Convert.ToInt32(((LSL_Types.LSLFloat) src.Data[index]).value); + else if (src.Data[index] is LSL_Types.LSLString) + return Convert.ToInt32(((LSL_Types.LSLString) src.Data[index]).m_string); return Convert.ToInt32(src.Data[index]); } catch (FormatException) @@ -3382,6 +3388,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { return 0.0; } + if (src.Data[index] is LSL_Types.LSLInteger) + return Convert.ToDouble(((LSL_Types.LSLInteger) src.Data[index]).value); + else if (src.Data[index] is LSL_Types.LSLFloat) + return Convert.ToDouble(((LSL_Types.LSLFloat) src.Data[index]).value); + else if (src.Data[index] is LSL_Types.LSLString) + return Convert.ToDouble(((LSL_Types.LSLString) src.Data[index]).m_string); return Convert.ToDouble(src.Data[index]); } @@ -3398,6 +3410,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } try { + if (src.Data[index] is LSL_Types.LSLInteger) + return Convert.ToDouble(((LSL_Types.LSLInteger) src.Data[index]).value); + else if (src.Data[index] is LSL_Types.LSLFloat) + return Convert.ToDouble(((LSL_Types.LSLFloat) src.Data[index]).value); + else if (src.Data[index] is LSL_Types.LSLString) + return Convert.ToDouble(((LSL_Types.LSLString) src.Data[index]).m_string); return Convert.ToDouble(src.Data[index]); } catch (FormatException) -- cgit v1.1