do lsl object rez checks on script thread before wasting time possible creating a new poll thread
parent
40b16f1705
commit
72bce8c4b4
|
@ -3534,32 +3534,34 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
public void doObjectRez(string inventory, LSL_Vector pos, LSL_Vector vel, LSL_Rotation rot, int param, bool atRoot)
|
public void doObjectRez(string inventory, LSL_Vector pos, LSL_Vector vel, LSL_Rotation rot, int param, bool atRoot)
|
||||||
{
|
{
|
||||||
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;
|
||||||
|
|
||||||
|
float dist = (float)llVecDist(llGetPos(), pos);
|
||||||
|
|
||||||
|
if (dist > m_ScriptDistanceFactor * 10.0f)
|
||||||
|
return;
|
||||||
|
|
||||||
|
TaskInventoryItem item = m_host.Inventory.GetInventoryItem(inventory);
|
||||||
|
|
||||||
|
if (item == null)
|
||||||
|
{
|
||||||
|
Error("llRez(AtRoot/Object)", "Can't find object '" + inventory + "'");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item.InvType != (int)InventoryType.Object)
|
||||||
|
{
|
||||||
|
Error("llRez(AtRoot/Object)", "Can't create requested object; object is missing from database");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Util.FireAndForget(x =>
|
Util.FireAndForget(x =>
|
||||||
{
|
{
|
||||||
if (Double.IsNaN(rot.x) || Double.IsNaN(rot.y) || Double.IsNaN(rot.z) || Double.IsNaN(rot.s))
|
|
||||||
return;
|
|
||||||
|
|
||||||
float dist = (float)llVecDist(llGetPos(), pos);
|
Quaternion wrot = rot;
|
||||||
|
wrot.Normalize();
|
||||||
if (dist > m_ScriptDistanceFactor * 10.0f)
|
List<SceneObjectGroup> new_groups = World.RezObject(m_host, item, pos, wrot, vel, param, atRoot);
|
||||||
return;
|
|
||||||
|
|
||||||
TaskInventoryItem item = m_host.Inventory.GetInventoryItem(inventory);
|
|
||||||
|
|
||||||
if (item == null)
|
|
||||||
{
|
|
||||||
Error("llRez(AtRoot/Object)", "Can't find object '" + inventory + "'");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item.InvType != (int)InventoryType.Object)
|
|
||||||
{
|
|
||||||
Error("llRez(AtRoot/Object)", "Can't create requested object; object is missing from database");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
List<SceneObjectGroup> new_groups = World.RezObject(m_host, item, pos, rot, vel, param, atRoot);
|
|
||||||
|
|
||||||
// If either of these are null, then there was an unknown error.
|
// If either of these are null, then there was an unknown error.
|
||||||
if (new_groups == null)
|
if (new_groups == null)
|
||||||
|
|
Loading…
Reference in New Issue