diff options
Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index d848b2a..562433d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | |||
@@ -560,12 +560,23 @@ namespace OpenSim.Region.ScriptEngine.Shared | |||
560 | else if (m_data[itemIndex] is LSL_Types.LSLString) | 560 | else if (m_data[itemIndex] is LSL_Types.LSLString) |
561 | return new LSLInteger(m_data[itemIndex].ToString()); | 561 | return new LSLInteger(m_data[itemIndex].ToString()); |
562 | else | 562 | else |
563 | throw new InvalidCastException(); | 563 | throw new InvalidCastException(string.Format( |
564 | "{0} expected but {1} given", | ||
565 | typeof(LSL_Types.LSLInteger).Name, | ||
566 | m_data[itemIndex] != null ? | ||
567 | m_data[itemIndex].GetType().Name : "null")); | ||
564 | } | 568 | } |
565 | 569 | ||
566 | public LSL_Types.Vector3 GetVector3Item(int itemIndex) | 570 | public LSL_Types.Vector3 GetVector3Item(int itemIndex) |
567 | { | 571 | { |
568 | return (LSL_Types.Vector3)m_data[itemIndex]; | 572 | if(m_data[itemIndex] is LSL_Types.Vector3) |
573 | return (LSL_Types.Vector3)m_data[itemIndex]; | ||
574 | else | ||
575 | throw new InvalidCastException(string.Format( | ||
576 | "{0} expected but {1} given", | ||
577 | typeof(LSL_Types.Vector3).Name, | ||
578 | m_data[itemIndex] != null ? | ||
579 | m_data[itemIndex].GetType().Name : "null")); | ||
569 | } | 580 | } |
570 | 581 | ||
571 | public LSL_Types.Quaternion GetQuaternionItem(int itemIndex) | 582 | public LSL_Types.Quaternion GetQuaternionItem(int itemIndex) |