From 1c7fbb86c21f79938e4ea9dafef1e8d8f4a29a8d Mon Sep 17 00:00:00 2001 From: teravus Date: Mon, 10 Jun 2013 18:47:08 -0500 Subject: Check For NaN and Infinity in llRot2Axis/Angle Fixes mantis #6669 --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index ec5aa49..9427061 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -4692,7 +4692,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api y = rot.y / s; z = rot.z / s; } - + if ((double.IsNaN(x)) || double.IsInfinity(x)) x = 0; + if ((double.IsNaN(y)) || double.IsInfinity(y)) y = 0; + if ((double.IsNaN(z)) || double.IsInfinity(z)) z = 0; return new LSL_Vector(x,y,z); } @@ -4714,7 +4716,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } double angle = 2 * Math.Acos(rot.s); - + if ((double.IsNaN(angle)) || double.IsInfinity(angle)) angle = 0; return angle; } -- cgit v1.1