diff options
author | Justin Clarke Casey | 2008-10-29 20:09:02 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-10-29 20:09:02 +0000 |
commit | 7fdd6b74e36185e1fa82042b7882da5b90d4caf7 (patch) | |
tree | c413c7a6a2054e25a9717074a2f70a472e3e7d4b /OpenSim/Region/ScriptEngine | |
parent | minor: indentation corrections (diff) | |
download | opensim-SC_OLD-7fdd6b74e36185e1fa82042b7882da5b90d4caf7.zip opensim-SC_OLD-7fdd6b74e36185e1fa82042b7882da5b90d4caf7.tar.gz opensim-SC_OLD-7fdd6b74e36185e1fa82042b7882da5b90d4caf7.tar.bz2 opensim-SC_OLD-7fdd6b74e36185e1fa82042b7882da5b90d4caf7.tar.xz |
* 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
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | 25 |
1 files changed, 25 insertions, 0 deletions
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 | |||
102 | return new Vector3(s); | 102 | return new Vector3(s); |
103 | } | 103 | } |
104 | 104 | ||
105 | public static explicit operator list(Vector3 vec) | ||
106 | { | ||
107 | return new list(new object[] { vec }); | ||
108 | } | ||
109 | |||
105 | public static bool operator ==(Vector3 lhs, Vector3 rhs) | 110 | public static bool operator ==(Vector3 lhs, Vector3 rhs) |
106 | { | 111 | { |
107 | return (lhs.x == rhs.x && lhs.y == rhs.y && lhs.z == rhs.z); | 112 | return (lhs.x == rhs.x && lhs.y == rhs.y && lhs.z == rhs.z); |
@@ -351,6 +356,11 @@ namespace OpenSim.Region.ScriptEngine.Shared | |||
351 | return new Quaternion(s); | 356 | return new Quaternion(s); |
352 | } | 357 | } |
353 | 358 | ||
359 | public static explicit operator list(Quaternion r) | ||
360 | { | ||
361 | return new list(new object[] { r }); | ||
362 | } | ||
363 | |||
354 | public static bool operator ==(Quaternion lhs, Quaternion rhs) | 364 | public static bool operator ==(Quaternion lhs, Quaternion rhs) |
355 | { | 365 | { |
356 | // Return true if the fields match: | 366 | // Return true if the fields match: |
@@ -1394,6 +1404,11 @@ namespace OpenSim.Region.ScriptEngine.Shared | |||
1394 | return new LSLFloat(Convert.ToDouble(s.m_string)); | 1404 | return new LSLFloat(Convert.ToDouble(s.m_string)); |
1395 | } | 1405 | } |
1396 | 1406 | ||
1407 | public static explicit operator list(LSLString s) | ||
1408 | { | ||
1409 | return new list(new object[]{s}); | ||
1410 | } | ||
1411 | |||
1397 | #endregion | 1412 | #endregion |
1398 | 1413 | ||
1399 | #region Overriders | 1414 | #region Overriders |
@@ -1488,6 +1503,11 @@ namespace OpenSim.Region.ScriptEngine.Shared | |||
1488 | return new LSLString(i.ToString()); | 1503 | return new LSLString(i.ToString()); |
1489 | } | 1504 | } |
1490 | 1505 | ||
1506 | public static explicit operator list(LSLInteger i) | ||
1507 | { | ||
1508 | return new list(new object[] { i }); | ||
1509 | } | ||
1510 | |||
1491 | static public implicit operator Boolean(LSLInteger i) | 1511 | static public implicit operator Boolean(LSLInteger i) |
1492 | { | 1512 | { |
1493 | if (i.value == 0) | 1513 | if (i.value == 0) |
@@ -1748,6 +1768,11 @@ namespace OpenSim.Region.ScriptEngine.Shared | |||
1748 | return new LSLFloat(double.Parse(v)); | 1768 | return new LSLFloat(double.Parse(v)); |
1749 | } | 1769 | } |
1750 | 1770 | ||
1771 | public static explicit operator list(LSLFloat f) | ||
1772 | { | ||
1773 | return new list(new object[] { f }); | ||
1774 | } | ||
1775 | |||
1751 | static public implicit operator LSLFloat(double d) | 1776 | static public implicit operator LSLFloat(double d) |
1752 | { | 1777 | { |
1753 | return new LSLFloat(d); | 1778 | return new LSLFloat(d); |