* 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!0.6.0-stable
parent
4c24b1bc9b
commit
87b8f327aa
|
@ -1553,16 +1553,39 @@ namespace OpenSim.Region.ScriptEngine.Shared
|
||||||
return new LSLInteger(0);
|
return new LSLInteger(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static public bool operator ==(LSLInteger i1, LSLInteger i2)
|
static public LSLInteger operator ==(LSLInteger i1, LSLInteger i2)
|
||||||
{
|
{
|
||||||
bool ret = i1.value == i2.value;
|
bool ret = i1.value == i2.value;
|
||||||
return ret;
|
return new LSLInteger((ret ? 1 : 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
static public bool operator !=(LSLInteger i1, LSLInteger i2)
|
static public LSLInteger operator !=(LSLInteger i1, LSLInteger i2)
|
||||||
{
|
{
|
||||||
bool ret = i1.value != i2.value;
|
bool ret = i1.value != i2.value;
|
||||||
return ret;
|
return new LSLInteger((ret ? 1 : 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
static public LSLInteger operator <(LSLInteger i1, LSLInteger i2)
|
||||||
|
{
|
||||||
|
bool ret = i1.value < i2.value;
|
||||||
|
return new LSLInteger((ret ? 1 : 0));
|
||||||
|
}
|
||||||
|
static public LSLInteger operator <=(LSLInteger i1, LSLInteger i2)
|
||||||
|
{
|
||||||
|
bool ret = i1.value <= i2.value;
|
||||||
|
return new LSLInteger((ret ? 1 : 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
static public LSLInteger operator >(LSLInteger i1, LSLInteger i2)
|
||||||
|
{
|
||||||
|
bool ret = i1.value > i2.value;
|
||||||
|
return new LSLInteger((ret ? 1 : 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
static public LSLInteger operator >=(LSLInteger i1, LSLInteger i2)
|
||||||
|
{
|
||||||
|
bool ret = i1.value >= i2.value;
|
||||||
|
return new LSLInteger((ret ? 1 : 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
static public LSLInteger operator +(LSLInteger i1, int i2)
|
static public LSLInteger operator +(LSLInteger i1, int i2)
|
||||||
|
|
Loading…
Reference in New Issue