diff options
author | UbitUmarov | 2018-11-17 17:05:28 +0000 |
---|---|---|
committer | UbitUmarov | 2018-11-17 17:05:28 +0000 |
commit | efd6fb05a9f3805ce19dc432b6d084497cd45573 (patch) | |
tree | 4dd255f52392a2e9c3fd4830559e28750129ef78 /OpenSim/Region/ScriptEngine/Shared | |
parent | code aesthetics (diff) | |
download | opensim-SC-efd6fb05a9f3805ce19dc432b6d084497cd45573.zip opensim-SC-efd6fb05a9f3805ce19dc432b6d084497cd45573.tar.gz opensim-SC-efd6fb05a9f3805ce19dc432b6d084497cd45573.tar.bz2 opensim-SC-efd6fb05a9f3805ce19dc432b6d084497cd45573.tar.xz |
code aesthetics
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | 52 |
1 files changed, 37 insertions, 15 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index e9ee937..0331a4c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | |||
@@ -84,16 +84,26 @@ namespace OpenSim.Region.ScriptEngine.Shared | |||
84 | { | 84 | { |
85 | str = str.Replace('<', ' '); | 85 | str = str.Replace('<', ' '); |
86 | str = str.Replace('>', ' '); | 86 | str = str.Replace('>', ' '); |
87 | string[] tmps = str.Split(new Char[] { ',', '<', '>' }); | 87 | string[] tmps = str.Split(new Char[] {','}); |
88 | if (tmps.Length < 3) | 88 | if (tmps.Length < 3) |
89 | { | 89 | { |
90 | x=y=z=0; | 90 | z = y = x = 0; |
91 | return; | 91 | return; |
92 | } | 92 | } |
93 | bool res; | 93 | if (!Double.TryParse(tmps[0], NumberStyles.Float, Culture.NumberFormatInfo, out x)) |
94 | res = Double.TryParse(tmps[0], NumberStyles.Float, Culture.NumberFormatInfo, out x); | 94 | { |
95 | res = res & Double.TryParse(tmps[1], NumberStyles.Float, Culture.NumberFormatInfo, out y); | 95 | z = y = 0; |
96 | res = res & Double.TryParse(tmps[2], NumberStyles.Float, Culture.NumberFormatInfo, out z); | 96 | return; |
97 | } | ||
98 | if (!Double.TryParse(tmps[1], NumberStyles.Float, Culture.NumberFormatInfo, out y)) | ||
99 | { | ||
100 | z = x = 0; | ||
101 | return; | ||
102 | } | ||
103 | if (!Double.TryParse(tmps[2], NumberStyles.Float, Culture.NumberFormatInfo, out z)) | ||
104 | { | ||
105 | y = x = 0; | ||
106 | } | ||
97 | } | 107 | } |
98 | 108 | ||
99 | #endregion | 109 | #endregion |
@@ -364,19 +374,31 @@ namespace OpenSim.Region.ScriptEngine.Shared | |||
364 | { | 374 | { |
365 | str = str.Replace('<', ' '); | 375 | str = str.Replace('<', ' '); |
366 | str = str.Replace('>', ' '); | 376 | str = str.Replace('>', ' '); |
367 | string[] tmps = str.Split(new Char[] { ',', '<', '>' }); | 377 | string[] tmps = str.Split(new Char[] {','}); |
368 | if (tmps.Length < 4) | 378 | if (tmps.Length < 4 || |
379 | !Double.TryParse(tmps[3], NumberStyles.Float, Culture.NumberFormatInfo, out s)) | ||
369 | { | 380 | { |
370 | x=y=z=s=0; | 381 | z = y = x = 0; |
382 | s = 1; | ||
371 | return; | 383 | return; |
372 | } | 384 | } |
373 | bool res; | 385 | if (!Double.TryParse(tmps[0], NumberStyles.Float, Culture.NumberFormatInfo, out x)) |
374 | res = Double.TryParse(tmps[0], NumberStyles.Float, Culture.NumberFormatInfo, out x); | 386 | { |
375 | res = res & Double.TryParse(tmps[1], NumberStyles.Float, Culture.NumberFormatInfo, out y); | 387 | z = y = 0; |
376 | res = res & Double.TryParse(tmps[2], NumberStyles.Float, Culture.NumberFormatInfo, out z); | 388 | s = 1; |
377 | res = res & Double.TryParse(tmps[3], NumberStyles.Float, Culture.NumberFormatInfo, out s); | 389 | return; |
378 | if (s == 0 && x == 0 && y == 0 && z == 0) | 390 | } |
391 | if (!Double.TryParse(tmps[1], NumberStyles.Float, Culture.NumberFormatInfo, out y)) | ||
392 | { | ||
393 | z = x = 0; | ||
379 | s = 1; | 394 | s = 1; |
395 | return; | ||
396 | } | ||
397 | if (!Double.TryParse(tmps[2], NumberStyles.Float, Culture.NumberFormatInfo, out z)) | ||
398 | { | ||
399 | y = x = 0; | ||
400 | s = 1; | ||
401 | } | ||
380 | } | 402 | } |
381 | 403 | ||
382 | public Quaternion(OMV_Quaternion rot) | 404 | public Quaternion(OMV_Quaternion rot) |