From 19ad7db5e1ebcce8fc13995270b2ebe94f8a9a52 Mon Sep 17 00:00:00 2001 From: Mike Mazur Date: Fri, 25 Jul 2008 07:50:31 +0000 Subject: Add casts from integer to float. Fix issue 1822. --- OpenSim/Region/ScriptEngine/Common/LSL_Types.cs | 5 +++++ OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | 5 +++++ 2 files changed, 10 insertions(+) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs index 0b28af0..7ac7a65 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs @@ -1454,6 +1454,11 @@ namespace OpenSim.Region.ScriptEngine.Common return new LSLFloat(i); } + static public implicit operator LSLFloat(LSLInteger i) + { + return new LSLFloat(i.value); + } + static public implicit operator LSLFloat(string s) { return new LSLFloat(double.Parse(s)); diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index f49d453..7eb5e77 100644 --- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs @@ -1509,6 +1509,11 @@ namespace OpenSim.Region.ScriptEngine.Shared return new LSLFloat(i); } + static public implicit operator LSLFloat(LSLInteger i) + { + return new LSLFloat(i.value); + } + static public implicit operator LSLFloat(string s) { return new LSLFloat(double.Parse(s)); -- cgit v1.1