aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
diff options
context:
space:
mode:
authorMike Mazur2008-07-18 02:05:20 +0000
committerMike Mazur2008-07-18 02:05:20 +0000
commit0b92ff4fde2a4266f200e38539d7e4530b7d4909 (patch)
treecc0405fc4a3d012c4113c6775499116038efa1ee /OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
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.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs18
1 files changed, 18 insertions, 0 deletions
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)