diff options
author | Melanie Thielker | 2008-09-02 03:43:18 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-09-02 03:43:18 +0000 |
commit | 61978649ec1642f1c0bf0a3aa6492cebefab85d3 (patch) | |
tree | 9310263acfcce74e72775baa97e094ed97d96195 /OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | |
parent | Y top shear accuracy improvements in circular path prim meshes (diff) | |
download | opensim-SC_OLD-61978649ec1642f1c0bf0a3aa6492cebefab85d3.zip opensim-SC_OLD-61978649ec1642f1c0bf0a3aa6492cebefab85d3.tar.gz opensim-SC_OLD-61978649ec1642f1c0bf0a3aa6492cebefab85d3.tar.bz2 opensim-SC_OLD-61978649ec1642f1c0bf0a3aa6492cebefab85d3.tar.xz |
Change some chat output functions so that text is truncated at
1000 chars to avoid the exception thrown by libomv at 1100 chars.
Change string->int conversion so it copes with non-numeric chars
after the number and no longer uses a float to parse the value.
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) |