diff options
author | Mike Mazur | 2008-07-18 02:05:20 +0000 |
---|---|---|
committer | Mike Mazur | 2008-07-18 02:05:20 +0000 |
commit | 0b92ff4fde2a4266f200e38539d7e4530b7d4909 (patch) | |
tree | cc0405fc4a3d012c4113c6775499116038efa1ee /OpenSim/Region/ScriptEngine/Shared/Api | |
parent | Mantis#1768. Thank you kindly, Junta_Kohime for a patch that: (diff) | |
download | opensim-SC_OLD-0b92ff4fde2a4266f200e38539d7e4530b7d4909.zip opensim-SC_OLD-0b92ff4fde2a4266f200e38539d7e4530b7d4909.tar.gz opensim-SC_OLD-0b92ff4fde2a4266f200e38539d7e4530b7d4909.tar.bz2 opensim-SC_OLD-0b92ff4fde2a4266f200e38539d7e4530b7d4909.tar.xz |
Treat LSL_Types as special cases in llList2Integer and llList2Float. This could be implemented many other places, but let's do that on a case-by-case basis.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index e7313e1..7f24f0e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -3363,6 +3363,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3363 | } | 3363 | } |
3364 | try | 3364 | try |
3365 | { | 3365 | { |
3366 | if (src.Data[index] is LSL_Types.LSLInteger) | ||
3367 | return Convert.ToInt32(((LSL_Types.LSLInteger) src.Data[index]).value); | ||
3368 | else if (src.Data[index] is LSL_Types.LSLFloat) | ||
3369 | return Convert.ToInt32(((LSL_Types.LSLFloat) src.Data[index]).value); | ||
3370 | else if (src.Data[index] is LSL_Types.LSLString) | ||
3371 | return Convert.ToInt32(((LSL_Types.LSLString) src.Data[index]).m_string); | ||
3366 | return Convert.ToInt32(src.Data[index]); | 3372 | return Convert.ToInt32(src.Data[index]); |
3367 | } | 3373 | } |
3368 | catch (FormatException) | 3374 | catch (FormatException) |
@@ -3382,6 +3388,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3382 | { | 3388 | { |
3383 | return 0.0; | 3389 | return 0.0; |
3384 | } | 3390 | } |
3391 | if (src.Data[index] is LSL_Types.LSLInteger) | ||
3392 | return Convert.ToDouble(((LSL_Types.LSLInteger) src.Data[index]).value); | ||
3393 | else if (src.Data[index] is LSL_Types.LSLFloat) | ||
3394 | return Convert.ToDouble(((LSL_Types.LSLFloat) src.Data[index]).value); | ||
3395 | else if (src.Data[index] is LSL_Types.LSLString) | ||
3396 | return Convert.ToDouble(((LSL_Types.LSLString) src.Data[index]).m_string); | ||
3385 | return Convert.ToDouble(src.Data[index]); | 3397 | return Convert.ToDouble(src.Data[index]); |
3386 | } | 3398 | } |
3387 | 3399 | ||
@@ -3398,6 +3410,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3398 | } | 3410 | } |
3399 | try | 3411 | try |
3400 | { | 3412 | { |
3413 | if (src.Data[index] is LSL_Types.LSLInteger) | ||
3414 | return Convert.ToDouble(((LSL_Types.LSLInteger) src.Data[index]).value); | ||
3415 | else if (src.Data[index] is LSL_Types.LSLFloat) | ||
3416 | return Convert.ToDouble(((LSL_Types.LSLFloat) src.Data[index]).value); | ||
3417 | else if (src.Data[index] is LSL_Types.LSLString) | ||
3418 | return Convert.ToDouble(((LSL_Types.LSLString) src.Data[index]).m_string); | ||
3401 | return Convert.ToDouble(src.Data[index]); | 3419 | return Convert.ToDouble(src.Data[index]); |
3402 | } | 3420 | } |
3403 | catch (FormatException) | 3421 | catch (FormatException) |