From 8407d7fbd2a5fcd9509c086661561f6a0604364d Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sun, 21 Sep 2008 12:18:30 +0000 Subject: Mantis #2230 The result of constants arithmetic can be a CLI type. This allows floating point CLI types to be parsed out of lists properly. --- OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index 27af8a5..91cef5e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs @@ -436,6 +436,18 @@ namespace OpenSim.Region.ScriptEngine.Shared { return (LSL_Types.LSLInteger)m_data[itemIndex]; } + else if (m_data[itemIndex] is Int32) + { + return new LSL_Types.LSLFloat((int)m_data[itemIndex]); + } + else if (m_data[itemIndex] is float) + { + return new LSL_Types.LSLFloat((float)m_data[itemIndex]); + } + else if (m_data[itemIndex] is Double) + { + return new LSL_Types.LSLFloat((Double)m_data[itemIndex]); + } else { return (LSL_Types.LSLFloat)m_data[itemIndex]; -- cgit v1.1