diff options
author | Melanie Thielker | 2008-09-08 19:29:16 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-09-08 19:29:16 +0000 |
commit | 6447d7132f0f443205e719a00e595f79444eea25 (patch) | |
tree | d28bbcc81e3ba99085ff679f29116111327b8c49 /OpenSim/Region/ScriptEngine | |
parent | Mantis #2147 (diff) | |
download | opensim-SC_OLD-6447d7132f0f443205e719a00e595f79444eea25.zip opensim-SC_OLD-6447d7132f0f443205e719a00e595f79444eea25.tar.gz opensim-SC_OLD-6447d7132f0f443205e719a00e595f79444eea25.tar.bz2 opensim-SC_OLD-6447d7132f0f443205e719a00e595f79444eea25.tar.xz |
Adapt the unit tests to the new list rules, change some casts to
new method for testing
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 13 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | 7 |
2 files changed, 13 insertions, 7 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index bc58a8a..4b92739 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -5614,12 +5614,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5614 | if (remain < 6) | 5614 | if (remain < 6) |
5615 | return; | 5615 | return; |
5616 | 5616 | ||
5617 | face = Convert.ToInt32(rules.Data[idx++].ToString()); // holeshape | 5617 | face = (int)rules.GetLSLIntegerItem(idx++); |
5618 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); // cut | 5618 | v = rules.GetVector3Item(idx++); // cut |
5619 | hollow = (float)Convert.ToDouble(rules.Data[idx++].ToString()); | 5619 | hollow = (float)rules.GetLSLFloatItem(idx++); |
5620 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5620 | twist = rules.GetVector3Item(idx++); |
5621 | taper_b = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5621 | taper_b = rules.GetVector3Item(idx++); |
5622 | topshear = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5622 | topshear = rules.GetVector3Item(idx++); |
5623 | |||
5623 | part.Shape.PathCurve = (byte)Extrusion.Straight; | 5624 | part.Shape.PathCurve = (byte)Extrusion.Straight; |
5624 | SetPrimitiveShapeParams(part, face, v, hollow, twist, taper_b, topshear, 1); | 5625 | SetPrimitiveShapeParams(part, face, v, hollow, twist, taper_b, topshear, 1); |
5625 | break; | 5626 | break; |
diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index 4554b0c..f149f60 100644 --- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | |||
@@ -454,7 +454,12 @@ namespace OpenSim.Region.ScriptEngine.Shared | |||
454 | 454 | ||
455 | public LSL_Types.LSLInteger GetLSLIntegerItem(int itemIndex) | 455 | public LSL_Types.LSLInteger GetLSLIntegerItem(int itemIndex) |
456 | { | 456 | { |
457 | return (LSL_Types.LSLInteger)m_data[itemIndex]; | 457 | if (m_data[itemIndex] is LSL_Types.LSLInteger) |
458 | return (LSL_Types.LSLInteger)m_data[itemIndex]; | ||
459 | else if (m_data[itemIndex] is Int32) | ||
460 | return new LSLInteger((int)m_data[itemIndex]); | ||
461 | else | ||
462 | throw new InvalidCastException(); | ||
458 | } | 463 | } |
459 | 464 | ||
460 | public LSL_Types.Vector3 GetVector3Item(int itemIndex) | 465 | public LSL_Types.Vector3 GetVector3Item(int itemIndex) |