From ef27c8817fb2899b02116296001770005622f375 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Wed, 3 Sep 2008 18:57:06 +0000 Subject: Mantis #2112 Thannk you, ralphos, for a patch to clean up list item type handling and add a missing explicit cast in Shared/ --- .../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 14 +++++++------- OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | 7 ++++++- 2 files changed, 13 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index d4911d7..aa22b2b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -5721,13 +5721,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (remain < 7) return; - LSL_Types.LSLInteger flexi = new LSL_Types.LSLInteger(rules.Data[idx++].ToString()); - int softness = Convert.ToInt32(rules.Data[idx++]); - float gravity = (float)Convert.ToDouble(rules.Data[idx++]); - float friction = (float)Convert.ToDouble(rules.Data[idx++]); - float wind = (float)Convert.ToDouble(rules.Data[idx++]); - float tension = (float)Convert.ToDouble(rules.Data[idx++]); - LSL_Types.Vector3 force =new LSL_Types.Vector3(rules.Data[idx++].ToString()); + bool flexi = (LSL_Types.LSLInteger)rules.Data[idx++]; + int softness = (LSL_Types.LSLInteger)rules.Data[idx++]; + float gravity = (float)(LSL_Types.LSLFloat)rules.Data[idx++]; + float friction = (float)(LSL_Types.LSLFloat)rules.Data[idx++]; + float wind = (float)(LSL_Types.LSLFloat)rules.Data[idx++]; + float tension = (float)(LSL_Types.LSLFloat)rules.Data[idx++]; + LSL_Types.Vector3 force = (LSL_Types.Vector3)rules.Data[idx++]; SetFlexi(part, flexi, softness, gravity, friction, wind, tension, force); diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index 3e63808..85abdb0 100644 --- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs @@ -1569,9 +1569,14 @@ namespace OpenSim.Region.ScriptEngine.Shared #region Operators + static public explicit operator float(LSLFloat f) + { + return (float)f.value; + } + static public explicit operator int(LSLFloat f) { - return (int)f.value; + return (int)f.value; } static public explicit operator uint(LSLFloat f) -- cgit v1.1