aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMike Mazur2008-07-18 02:05:20 +0000
committerMike Mazur2008-07-18 02:05:20 +0000
commit0b92ff4fde2a4266f200e38539d7e4530b7d4909 (patch)
treecc0405fc4a3d012c4113c6775499116038efa1ee
parentMantis#1768. Thank you kindly, Junta_Kohime for a patch that: (diff)
downloadopensim-SC-0b92ff4fde2a4266f200e38539d7e4530b7d4909.zip
opensim-SC-0b92ff4fde2a4266f200e38539d7e4530b7d4909.tar.gz
opensim-SC-0b92ff4fde2a4266f200e38539d7e4530b7d4909.tar.bz2
opensim-SC-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.
-rw-r--r--CONTRIBUTORS.txt1
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs18
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs18
3 files changed, 37 insertions, 0 deletions
diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt
index e553a45..ba19a29 100644
--- a/CONTRIBUTORS.txt
+++ b/CONTRIBUTORS.txt
@@ -28,6 +28,7 @@ OpenSim Developers
28* Alondria 28* Alondria
29* Dr Scofield (IBM) 29* Dr Scofield (IBM)
30* dahlia 30* dahlia
31* mikem (3Di)
31 32
32 33
33Patches 34Patches
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
index 3ae1f3a..3e5e12c 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
@@ -3421,6 +3421,12 @@ namespace OpenSim.Region.ScriptEngine.Common
3421 } 3421 }
3422 try 3422 try
3423 { 3423 {
3424 if (src.Data[index] is LSL_Types.LSLInteger)
3425 return Convert.ToInt32(((LSL_Types.LSLInteger) src.Data[index]).value);
3426 else if (src.Data[index] is LSL_Types.LSLFloat)
3427 return Convert.ToInt32(((LSL_Types.LSLFloat) src.Data[index]).value);
3428 else if (src.Data[index] is LSL_Types.LSLString)
3429 return Convert.ToInt32(((LSL_Types.LSLString) src.Data[index]).m_string);
3424 return Convert.ToInt32(src.Data[index]); 3430 return Convert.ToInt32(src.Data[index]);
3425 } 3431 }
3426 catch (FormatException) 3432 catch (FormatException)
@@ -3440,6 +3446,12 @@ namespace OpenSim.Region.ScriptEngine.Common
3440 { 3446 {
3441 return 0.0; 3447 return 0.0;
3442 } 3448 }
3449 if (src.Data[index] is LSL_Types.LSLInteger)
3450 return Convert.ToDouble(((LSL_Types.LSLInteger) src.Data[index]).value);
3451 else if (src.Data[index] is LSL_Types.LSLFloat)
3452 return Convert.ToDouble(((LSL_Types.LSLFloat) src.Data[index]).value);
3453 else if (src.Data[index] is LSL_Types.LSLString)
3454 return Convert.ToDouble(((LSL_Types.LSLString) src.Data[index]).m_string);
3443 return Convert.ToDouble(src.Data[index]); 3455 return Convert.ToDouble(src.Data[index]);
3444 } 3456 }
3445 3457
@@ -3456,6 +3468,12 @@ namespace OpenSim.Region.ScriptEngine.Common
3456 } 3468 }
3457 try 3469 try
3458 { 3470 {
3471 if (src.Data[index] is LSL_Types.LSLInteger)
3472 return Convert.ToDouble(((LSL_Types.LSLInteger) src.Data[index]).value);
3473 else if (src.Data[index] is LSL_Types.LSLFloat)
3474 return Convert.ToDouble(((LSL_Types.LSLFloat) src.Data[index]).value);
3475 else if (src.Data[index] is LSL_Types.LSLString)
3476 return Convert.ToDouble(((LSL_Types.LSLString) src.Data[index]).m_string);
3459 return Convert.ToDouble(src.Data[index]); 3477 return Convert.ToDouble(src.Data[index]);
3460 } 3478 }
3461 catch (FormatException) 3479 catch (FormatException)
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)