diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index babb759..23177e5 100644 --- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | |||
@@ -1394,8 +1394,15 @@ namespace OpenSim.Region.ScriptEngine.Shared | |||
1394 | 1394 | ||
1395 | static public explicit operator LSLInteger(string s) | 1395 | static public explicit operator LSLInteger(string s) |
1396 | { | 1396 | { |
1397 | Regex r = new Regex("^[0-9][0-9]*"); | ||
1398 | Match m = r.Match(s); | ||
1399 | string v = m.Groups[0].Value; | ||
1400 | |||
1401 | if (v == String.Empty) | ||
1402 | v = "0"; | ||
1403 | |||
1397 | // double.Parse() used because s could be "123.9" for example. | 1404 | // double.Parse() used because s could be "123.9" for example. |
1398 | return new LSLInteger(double.Parse(s)); | 1405 | return new LSLInteger(int.Parse(v)); |
1399 | } | 1406 | } |
1400 | 1407 | ||
1401 | static public implicit operator LSLInteger(uint u) | 1408 | static public implicit operator LSLInteger(uint u) |