From 8cc8d15f950657d4d021fc81d14a8715007e7bb4 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 5 Nov 2016 20:14:11 +0000 Subject: some types may already be native in MOD_Api ConvertFromLSL --- OpenSim/Region/ClientStack/Linden/UDP/ThrottleRates.cs | 2 +- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs | 6 +++++- OpenSim/Region/ScriptEngine/Shared/Tests/LSL_TypesTestList.cs | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/ThrottleRates.cs b/OpenSim/Region/ClientStack/Linden/UDP/ThrottleRates.cs index 4448b72..a476b91 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/ThrottleRates.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/ThrottleRates.cs @@ -105,7 +105,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP AdaptiveThrottlesEnabled = false; MinimumAdaptiveThrottleRate = throttleConfig.GetInt("adaptive_throttle_min_bps", 32000); - // http textures do use udp bandwith setting + // http textures do use udp bandwidth setting // CannibalizeTextureRate = (double)throttleConfig.GetFloat("CannibalizeTextureRate", 0.0f); // CannibalizeTextureRate = Util.Clamp(CannibalizeTextureRate,0.0, 0.9); CannibalizeTextureRate = 0f; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs index 7bd4fa7..1e26036 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs @@ -365,8 +365,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// protected object ConvertFromLSL(object lslparm, Type type, string fname) { + + if(lslparm.GetType() == type) + return lslparm; + // ---------- String ---------- - if (lslparm is LSL_String) + else if (lslparm is LSL_String) { if (type == typeof(string)) return (string)(LSL_String)lslparm; diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_TypesTestList.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_TypesTestList.cs index 20bbd72..fe2113b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_TypesTestList.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_TypesTestList.cs @@ -270,7 +270,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests TestHelpers.InMethod(); LSL_Types.Quaternion testValue = new LSL_Types.Quaternion(12.64, 59.43723, 765.3421, 4.00987); - // make that nonesense a quartenion + // make that nonsense a quaternion testValue.Normalize(); LSL_Types.list testList = new LSL_Types.list(testValue); -- cgit v1.1