diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index e553a45b8e..ba19a29ac6 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -28,6 +28,7 @@ OpenSim Developers * Alondria * Dr Scofield (IBM) * dahlia +* mikem (3Di) Patches diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 3ae1f3a926..3e5e12c2bb 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs @@ -3421,6 +3421,12 @@ namespace OpenSim.Region.ScriptEngine.Common } 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) @@ -3440,6 +3446,12 @@ namespace OpenSim.Region.ScriptEngine.Common { 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]); } @@ -3456,6 +3468,12 @@ namespace OpenSim.Region.ScriptEngine.Common } 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) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index e7313e1c44..7f24f0e70f 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)