Implement cast to LSL_Types.LSLInteger from double. Fix issue 1770.

0.6.0-stable
Mike Mazur 2008-07-18 07:52:44 +00:00
parent e0e0db3660
commit 8b613e677f
2 changed files with 10 additions and 0 deletions

View File

@ -1281,6 +1281,11 @@ namespace OpenSim.Region.ScriptEngine.Common
return new LSLInteger(u); return new LSLInteger(u);
} }
static public implicit operator LSLInteger(double d)
{
return new LSLInteger(d);
}
static public bool operator ==(LSLInteger i1, LSLInteger i2) static public bool operator ==(LSLInteger i1, LSLInteger i2)
{ {
bool ret = i1.value == i2.value; bool ret = i1.value == i2.value;

View File

@ -1309,6 +1309,11 @@ namespace OpenSim.Region.ScriptEngine.Shared
return new LSLInteger(u); return new LSLInteger(u);
} }
static public implicit operator LSLInteger(double d)
{
return new LSLInteger(d);
}
static public bool operator ==(LSLInteger i1, LSLInteger i2) static public bool operator ==(LSLInteger i1, LSLInteger i2)
{ {
bool ret = i1.value == i2.value; bool ret = i1.value == i2.value;