BUG FIX prevent references to null scene (as happens on mesh uploads)

avinationmerge
UbitUmarov 2014-11-03 00:03:53 +00:00
parent 377a8072dc
commit 37a5eab0f5
1 changed files with 15 additions and 12 deletions

View File

@ -529,21 +529,21 @@ namespace OpenSim.Region.Framework.Scenes
set set
{ {
Vector3 val = value; Vector3 val = value;
if (Scene != null && !IsAttachmentCheckFull()
if (!IsAttachmentCheckFull() && !Scene.LoadingPrims && && !Scene.LoadingPrims &&
( Scene.TestBorderCross(val, Cardinals.E) || (Scene.TestBorderCross(val, Cardinals.E) ||
Scene.TestBorderCross(val, Cardinals.W) || Scene.TestBorderCross(val, Cardinals.W) ||
Scene.TestBorderCross(val, Cardinals.N) || Scene.TestBorderCross(val, Cardinals.N) ||
Scene.TestBorderCross(val, Cardinals.S)) Scene.TestBorderCross(val, Cardinals.S))
) )
{ {
if (!inTransit) if (!inTransit)
{ {
inTransit = true; inTransit = true;
SOGCrossDelegate d = CrossAsync; SOGCrossDelegate d = CrossAsync;
d.BeginInvoke(this, val, CrossAsyncCompleted, d); d.BeginInvoke(this, val, CrossAsyncCompleted, d);
} }
return; return;
} }
if (RootPart.GetStatusSandbox()) if (RootPart.GetStatusSandbox())
@ -582,6 +582,7 @@ namespace OpenSim.Region.Framework.Scenes
av.sitSOGmoved(); av.sitSOGmoved();
} }
// now that position is changed tell it to scripts // now that position is changed tell it to scripts
if (triggerScriptEvent) if (triggerScriptEvent)
{ {
@ -591,7 +592,9 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
Scene.EventManager.TriggerParcelPrimCountTainted(); if (Scene != null)
Scene.EventManager.TriggerParcelPrimCountTainted();
} }
} }
@ -789,7 +792,7 @@ namespace OpenSim.Region.Framework.Scenes
{ {
if (agent.ParentUUID != UUID.Zero) if (agent.ParentUUID != UUID.Zero)
{ {
agent.ClearControls(); agent.HandleForceReleaseControls(agent.ControllingClient,agent.UUID);
agent.ParentPart = null; agent.ParentPart = null;
// agent.ParentPosition = Vector3.Zero; // agent.ParentPosition = Vector3.Zero;
// agent.ParentUUID = UUID.Zero; // agent.ParentUUID = UUID.Zero;