From 7eda940e7f776ff823eee1551265b65d14157f30 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Tue, 11 Nov 2008 01:02:48 +0000 Subject: Fix llList2Integer to have the same semantics as an (integer) cast. Handle mixed number/letter content properly. --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 6f9e0a0..d141ffe 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -4167,12 +4167,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api try { if (src.Data[index] is LSL_Integer) - return Convert.ToInt32(((LSL_Integer) src.Data[index]).value); + return (LSL_Integer) src.Data[index]; else if (src.Data[index] is LSL_Float) return Convert.ToInt32(((LSL_Float) src.Data[index]).value); - else if (src.Data[index] is LSL_String) - return Convert.ToInt32(((LSL_String) src.Data[index]).m_string); - return Convert.ToInt32(src.Data[index]); + return new LSL_Integer(src.Data[index].ToString()); } catch (FormatException) { -- cgit v1.1