aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorlbsa712009-04-09 07:33:05 +0000
committerlbsa712009-04-09 07:33:05 +0000
commit99bf4ce72f881996ebb5006f112d204c5cdd8ccd (patch)
tree1725e1622e42249d0468533b891226bd62f748ad /OpenSim
parent* argh. reverted untested fix that snuck into the last commit (diff)
downloadopensim-SC_OLD-99bf4ce72f881996ebb5006f112d204c5cdd8ccd.zip
opensim-SC_OLD-99bf4ce72f881996ebb5006f112d204c5cdd8ccd.tar.gz
opensim-SC_OLD-99bf4ce72f881996ebb5006f112d204c5cdd8ccd.tar.bz2
opensim-SC_OLD-99bf4ce72f881996ebb5006f112d204c5cdd8ccd.tar.xz
* Fixed a number of culture-variant bugs in lsl implicit type conversions.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs20
1 files changed, 11 insertions, 9 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
index 93a6300..cb1c7ce 100644
--- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
@@ -27,7 +27,9 @@
27 27
28using System; 28using System;
29using System.Collections; 29using System.Collections;
30using System.Globalization;
30using System.Text.RegularExpressions; 31using System.Text.RegularExpressions;
32using OpenSim.Framework;
31 33
32namespace OpenSim.Region.ScriptEngine.Shared 34namespace OpenSim.Region.ScriptEngine.Shared
33{ 35{
@@ -307,10 +309,10 @@ namespace OpenSim.Region.ScriptEngine.Shared
307 return; 309 return;
308 } 310 }
309 bool res; 311 bool res;
310 res = Double.TryParse(tmps[0], out x); 312 res = Double.TryParse(tmps[0], NumberStyles.Float, Culture.FormatProvider, out x);
311 res = res & Double.TryParse(tmps[1], out y); 313 res = res & Double.TryParse(tmps[1], NumberStyles.Float, Culture.FormatProvider, out y);
312 res = res & Double.TryParse(tmps[2], out z); 314 res = res & Double.TryParse(tmps[2], NumberStyles.Float, Culture.FormatProvider, out z);
313 res = res & Double.TryParse(tmps[3], out s); 315 res = res & Double.TryParse(tmps[3], NumberStyles.Float, Culture.FormatProvider, out s);
314 if (x == 0 && y == 0 && z == 0 && s == 0) 316 if (x == 0 && y == 0 && z == 0 && s == 0)
315 s = 1; 317 s = 1;
316 } 318 }
@@ -335,7 +337,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
335 337
336 public override string ToString() 338 public override string ToString()
337 { 339 {
338 string st=String.Format("<{0:0.000000},{1:0.000000},{2:0.000000},{3:0.000000}>", x, y, z, s); 340 string st=String.Format(Culture.FormatProvider, "<{0:0.000000},{1:0.000000},{2:0.000000},{3:0.000000}>", x, y, z, s);
339 return st; 341 return st;
340 } 342 }
341 343
@@ -1319,13 +1321,13 @@ namespace OpenSim.Region.ScriptEngine.Shared
1319 1321
1320 public LSLString(double d) 1322 public LSLString(double d)
1321 { 1323 {
1322 string s=String.Format("{0:0.000000}", d); 1324 string s=String.Format(Culture.FormatProvider, "{0:0.000000}", d);
1323 m_string=s; 1325 m_string=s;
1324 } 1326 }
1325 1327
1326 public LSLString(LSLFloat f) 1328 public LSLString(LSLFloat f)
1327 { 1329 {
1328 string s=String.Format("{0:0.000000}", f.value); 1330 string s = String.Format(Culture.FormatProvider, "{0:0.000000}", f.value);
1329 m_string=s; 1331 m_string=s;
1330 } 1332 }
1331 1333
@@ -1787,7 +1789,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
1787 else 1789 else
1788 if (v.EndsWith(".")) 1790 if (v.EndsWith("."))
1789 v = v + "0"; 1791 v = v + "0";
1790 this.value = double.Parse(v, System.Globalization.NumberStyles.Float); 1792 this.value = double.Parse(v, System.Globalization.NumberStyles.Float, Culture.FormatProvider);
1791 } 1793 }
1792 1794
1793 #endregion 1795 #endregion
@@ -1932,7 +1934,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
1932 1934
1933 public override string ToString() 1935 public override string ToString()
1934 { 1936 {
1935 return String.Format("{0:0.000000}", this.value); 1937 return String.Format(Culture.FormatProvider, "{0:0.000000}", this.value);
1936 } 1938 }
1937 1939
1938 public override bool Equals(Object o) 1940 public override bool Equals(Object o)