diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 5caade6..ca09705 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -5123,7 +5123,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5123 | else if (src.Data[index] is LSL_Float) | 5123 | else if (src.Data[index] is LSL_Float) |
5124 | return Convert.ToDouble(((LSL_Float) src.Data[index]).value); | 5124 | return Convert.ToDouble(((LSL_Float) src.Data[index]).value); |
5125 | else if (src.Data[index] is LSL_String) | 5125 | else if (src.Data[index] is LSL_String) |
5126 | return Convert.ToDouble(((LSL_String) src.Data[index]).m_string); | 5126 | { |
5127 | string str = ((LSL_String) src.Data[index]).m_string; | ||
5128 | Match m = Regex.Match(str, "^\\s*(-?+?[0-9,]+\\.?[0-9]*)"); | ||
5129 | if (m != Match.Empty) | ||
5130 | { | ||
5131 | str = m.Value; | ||
5132 | double d = 0.0; | ||
5133 | if (!Double.TryParse(str, out d)) | ||
5134 | return 0.0; | ||
5135 | |||
5136 | return d; | ||
5137 | } | ||
5138 | return 0.0; | ||
5139 | } | ||
5127 | return Convert.ToDouble(src.Data[index]); | 5140 | return Convert.ToDouble(src.Data[index]); |
5128 | } | 5141 | } |
5129 | catch (FormatException) | 5142 | catch (FormatException) |