diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs')
-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) |