Guard LLRezObject against NaN

0.6.0-stable
Melanie Thielker 2008-09-19 17:34:35 +00:00
parent 592f98c4aa
commit 5d3fe9f8cd
2 changed files with 6 additions and 2 deletions

View File

@ -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) public void llRezAtRoot(string inventory, LSL_Types.Vector3 pos, LSL_Types.Vector3 vel, LSL_Types.Quaternion rot, int param)
{ {
m_host.AddScriptLPS(1); 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; bool found = false;
float dist = (float)llVecDist(llGetPos(), pos); float dist = (float)llVecDist(llGetPos(), pos);

View File

@ -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) 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); float dist = (float)llVecMag(llGetPos() - pos);
if (dist > m_ScriptDistanceFactor * 10.0f) if (dist > m_ScriptDistanceFactor * 10.0f)
return; return;
m_host.AddScriptLPS(1);
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory) foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
{ {
if (inv.Value.Name == inventory) if (inv.Value.Name == inventory)