From 7fdd6b74e36185e1fa82042b7882da5b90d4caf7 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Wed, 29 Oct 2008 20:09:02 +0000 Subject: * Apply patch in http://opensimulator.org/mantis/view.php?id=2494 * Introduces missing casts for float, integer, vector, quaterion and string to list * Thanks idb --- OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index f3a2997..36320d2 100644 --- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs @@ -102,6 +102,11 @@ namespace OpenSim.Region.ScriptEngine.Shared return new Vector3(s); } + public static explicit operator list(Vector3 vec) + { + return new list(new object[] { vec }); + } + public static bool operator ==(Vector3 lhs, Vector3 rhs) { return (lhs.x == rhs.x && lhs.y == rhs.y && lhs.z == rhs.z); @@ -351,6 +356,11 @@ namespace OpenSim.Region.ScriptEngine.Shared return new Quaternion(s); } + public static explicit operator list(Quaternion r) + { + return new list(new object[] { r }); + } + public static bool operator ==(Quaternion lhs, Quaternion rhs) { // Return true if the fields match: @@ -1394,6 +1404,11 @@ namespace OpenSim.Region.ScriptEngine.Shared return new LSLFloat(Convert.ToDouble(s.m_string)); } + public static explicit operator list(LSLString s) + { + return new list(new object[]{s}); + } + #endregion #region Overriders @@ -1488,6 +1503,11 @@ namespace OpenSim.Region.ScriptEngine.Shared return new LSLString(i.ToString()); } + public static explicit operator list(LSLInteger i) + { + return new list(new object[] { i }); + } + static public implicit operator Boolean(LSLInteger i) { if (i.value == 0) @@ -1748,6 +1768,11 @@ namespace OpenSim.Region.ScriptEngine.Shared return new LSLFloat(double.Parse(v)); } + public static explicit operator list(LSLFloat f) + { + return new list(new object[] { f }); + } + static public implicit operator LSLFloat(double d) { return new LSLFloat(d); -- cgit v1.1