From 8b613e677f269237bcbf2ddc2b1b826c18f514c7 Mon Sep 17 00:00:00 2001 From: Mike Mazur Date: Fri, 18 Jul 2008 07:52:44 +0000 Subject: [PATCH] Implement cast to LSL_Types.LSLInteger from double. Fix issue 1770. --- OpenSim/Region/ScriptEngine/Common/LSL_Types.cs | 5 +++++ OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs index c630c27ce9..be790d6f3c 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs @@ -1281,6 +1281,11 @@ namespace OpenSim.Region.ScriptEngine.Common return new LSLInteger(u); } + static public implicit operator LSLInteger(double d) + { + return new LSLInteger(d); + } + static public bool operator ==(LSLInteger i1, LSLInteger i2) { bool ret = i1.value == i2.value; diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index f71d5840ab..0cddf369f9 100644 --- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs @@ -1309,6 +1309,11 @@ namespace OpenSim.Region.ScriptEngine.Shared return new LSLInteger(u); } + static public implicit operator LSLInteger(double d) + { + return new LSLInteger(d); + } + static public bool operator ==(LSLInteger i1, LSLInteger i2) { bool ret = i1.value == i2.value;