From 8b613e677f269237bcbf2ddc2b1b826c18f514c7 Mon Sep 17 00:00:00 2001
From: Mike Mazur
Date: Fri, 18 Jul 2008 07:52:44 +0000
Subject: 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(+)

(limited to 'OpenSim')

diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs
index c630c27..be790d6 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 f71d584..0cddf36 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;
-- 
cgit v1.1