From fb312279c98fb832652345942c31796228f25ac5 Mon Sep 17 00:00:00 2001 From: Talun Date: Fri, 21 Mar 2014 11:31:44 +0000 Subject: [PATCH] Mantis 6922: No particles are generated if their size exceeds the maximum allowed size. This patch ensures that no particle scal value can exceed 4.0 --- .../Shared/Api/Implementation/LSL_Api.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 09c295a8f9..427800273c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -6409,14 +6409,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api case (int)ScriptBaseClass.PSYS_PART_START_SCALE: tempv = rules.GetVector3Item(i + 1); - prules.PartStartScaleX = (float)tempv.x; - prules.PartStartScaleY = (float)tempv.y; + prules.PartStartScaleX = validParticleScale((float)tempv.x); + prules.PartStartScaleY = validParticleScale((float)tempv.y); break; case (int)ScriptBaseClass.PSYS_PART_END_SCALE: tempv = rules.GetVector3Item(i + 1); - prules.PartEndScaleX = (float)tempv.x; - prules.PartEndScaleY = (float)tempv.y; + prules.PartEndScaleX = validParticleScale((float)tempv.x); + prules.PartEndScaleY = validParticleScale((float)tempv.y); break; case (int)ScriptBaseClass.PSYS_PART_MAX_AGE: @@ -6547,6 +6547,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api part.SendFullUpdateToAllClients(); } + private float validParticleScale(float value) + { + if (value > 4.0f) return 4.0f; + return value; + } + public void llGroundRepel(double height, int water, double tau) { m_host.AddScriptLPS(1);