aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs29
1 files changed, 27 insertions, 2 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
index fcb98a5..44fdd1a 100644
--- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
@@ -631,19 +631,44 @@ namespace OpenSim.Region.ScriptEngine.Shared
631 631
632 public LSL_Types.Vector3 GetVector3Item(int itemIndex) 632 public LSL_Types.Vector3 GetVector3Item(int itemIndex)
633 { 633 {
634 if(m_data[itemIndex] is LSL_Types.Vector3) 634 if (m_data[itemIndex] is LSL_Types.Vector3)
635 {
635 return (LSL_Types.Vector3)m_data[itemIndex]; 636 return (LSL_Types.Vector3)m_data[itemIndex];
637 }
638 else if(m_data[itemIndex] is OpenMetaverse.Vector3)
639 {
640 return new LSL_Types.Vector3(
641 (OpenMetaverse.Vector3)m_data[itemIndex]);
642 }
636 else 643 else
644 {
637 throw new InvalidCastException(string.Format( 645 throw new InvalidCastException(string.Format(
638 "{0} expected but {1} given", 646 "{0} expected but {1} given",
639 typeof(LSL_Types.Vector3).Name, 647 typeof(LSL_Types.Vector3).Name,
640 m_data[itemIndex] != null ? 648 m_data[itemIndex] != null ?
641 m_data[itemIndex].GetType().Name : "null")); 649 m_data[itemIndex].GetType().Name : "null"));
650 }
642 } 651 }
643 652
644 public LSL_Types.Quaternion GetQuaternionItem(int itemIndex) 653 public LSL_Types.Quaternion GetQuaternionItem(int itemIndex)
645 { 654 {
646 return (LSL_Types.Quaternion)m_data[itemIndex]; 655 if (m_data[itemIndex] is LSL_Types.Quaternion)
656 {
657 return (LSL_Types.Quaternion)m_data[itemIndex];
658 }
659 else if(m_data[itemIndex] is OpenMetaverse.Quaternion)
660 {
661 return new LSL_Types.Quaternion(
662 (OpenMetaverse.Quaternion)m_data[itemIndex]);
663 }
664 else
665 {
666 throw new InvalidCastException(string.Format(
667 "{0} expected but {1} given",
668 typeof(LSL_Types.Quaternion).Name,
669 m_data[itemIndex] != null ?
670 m_data[itemIndex].GetType().Name : "null"));
671 }
647 } 672 }
648 673
649 public LSL_Types.key GetKeyItem(int itemIndex) 674 public LSL_Types.key GetKeyItem(int itemIndex)