From 5d3fe9f8cdcb6c7b6e43ec817b3c955d36f7fcee Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 19 Sep 2008 17:34:35 +0000 Subject: Guard LLRezObject against NaN --- OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 2 ++ OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index dbb61fd..6623165 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs @@ -2318,6 +2318,8 @@ namespace OpenSim.Region.ScriptEngine.Common public void llRezAtRoot(string inventory, LSL_Types.Vector3 pos, LSL_Types.Vector3 vel, LSL_Types.Quaternion rot, int param) { m_host.AddScriptLPS(1); + if (Double.IsNaN(rot.x) || Double.IsNaN(rot.y) || Double.IsNaN(rot.z) || Double.IsNaN(rot.s)) + return; bool found = false; float dist = (float)llVecDist(llGetPos(), pos); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index bff63f1..0cfa06f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -2200,13 +2200,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llRezAtRoot(string inventory, LSL_Types.Vector3 pos, LSL_Types.Vector3 vel, LSL_Types.Quaternion rot, int param) { + m_host.AddScriptLPS(1); + + if (Double.IsNaN(rot.x) || Double.IsNaN(rot.y) || Double.IsNaN(rot.z) || Double.IsNaN(rot.s)) + return; float dist = (float)llVecMag(llGetPos() - pos); if (dist > m_ScriptDistanceFactor * 10.0f) return; - m_host.AddScriptLPS(1); - foreach (KeyValuePair inv in m_host.TaskInventory) { if (inv.Value.Name == inventory) -- cgit v1.1