mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 08:55:56 +08:00
* 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
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user