Fix llList2Integer to have the same semantics as an (integer) cast. Handle

mixed number/letter content properly.
0.6.1-post-fixes
Melanie Thielker 2008-11-11 01:02:48 +00:00
parent 5276c4bdf8
commit 7eda940e7f
1 changed files with 2 additions and 4 deletions

View File

@ -4167,12 +4167,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
try try
{ {
if (src.Data[index] is LSL_Integer) 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) else if (src.Data[index] is LSL_Float)
return Convert.ToInt32(((LSL_Float) src.Data[index]).value); return Convert.ToInt32(((LSL_Float) src.Data[index]).value);
else if (src.Data[index] is LSL_String) return new LSL_Integer(src.Data[index].ToString());
return Convert.ToInt32(((LSL_String) src.Data[index]).m_string);
return Convert.ToInt32(src.Data[index]);
} }
catch (FormatException) catch (FormatException)
{ {