aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-11-01 23:15:16 +0000
committerJustin Clarke Casey2008-11-01 23:15:16 +0000
commit87b8f327aab6d14f8682051d7867750d72bea085 (patch)
tree598e9c1bc5c3cac90ce1cc7a0771113075e3c50e /OpenSim/Region
parent* Massive cleanup of LLClientView, removed a few hundred unnecessary value in... (diff)
downloadopensim-SC_OLD-87b8f327aab6d14f8682051d7867750d72bea085.zip
opensim-SC_OLD-87b8f327aab6d14f8682051d7867750d72bea085.tar.gz
opensim-SC_OLD-87b8f327aab6d14f8682051d7867750d72bea085.tar.bz2
opensim-SC_OLD-87b8f327aab6d14f8682051d7867750d72bea085.tar.xz
* Apply http://opensimulator.org/mantis/view.php?id=2440
* The attached patch changes the LSLInteger operator overrides for == and != to return LSLIntegers 1 or 0 instead of a bool and adds similar operator overrides for >, <, >= and <= * Thanks idb!
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs31
1 files changed, 27 insertions, 4 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
index f3adb22..6c78ef8 100644
--- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
@@ -1553,16 +1553,39 @@ namespace OpenSim.Region.ScriptEngine.Shared
1553 return new LSLInteger(0); 1553 return new LSLInteger(0);
1554 } 1554 }
1555 1555
1556 static public bool operator ==(LSLInteger i1, LSLInteger i2) 1556 static public LSLInteger operator ==(LSLInteger i1, LSLInteger i2)
1557 { 1557 {
1558 bool ret = i1.value == i2.value; 1558 bool ret = i1.value == i2.value;
1559 return ret; 1559 return new LSLInteger((ret ? 1 : 0));
1560 } 1560 }
1561 1561
1562 static public bool operator !=(LSLInteger i1, LSLInteger i2) 1562 static public LSLInteger operator !=(LSLInteger i1, LSLInteger i2)
1563 { 1563 {
1564 bool ret = i1.value != i2.value; 1564 bool ret = i1.value != i2.value;
1565 return ret; 1565 return new LSLInteger((ret ? 1 : 0));
1566 }
1567
1568 static public LSLInteger operator <(LSLInteger i1, LSLInteger i2)
1569 {
1570 bool ret = i1.value < i2.value;
1571 return new LSLInteger((ret ? 1 : 0));
1572 }
1573 static public LSLInteger operator <=(LSLInteger i1, LSLInteger i2)
1574 {
1575 bool ret = i1.value <= i2.value;
1576 return new LSLInteger((ret ? 1 : 0));
1577 }
1578
1579 static public LSLInteger operator >(LSLInteger i1, LSLInteger i2)
1580 {
1581 bool ret = i1.value > i2.value;
1582 return new LSLInteger((ret ? 1 : 0));
1583 }
1584
1585 static public LSLInteger operator >=(LSLInteger i1, LSLInteger i2)
1586 {
1587 bool ret = i1.value >= i2.value;
1588 return new LSLInteger((ret ? 1 : 0));
1566 } 1589 }
1567 1590
1568 static public LSLInteger operator +(LSLInteger i1, int i2) 1591 static public LSLInteger operator +(LSLInteger i1, int i2)