Check for null scene in ScheduleFullUpdate and ScheduleTerseUpdate before triggering events on a potentially null Scene

iar_mods
Dan Lake 2012-02-03 15:18:48 -08:00
parent 3257dbe76d
commit 107cef2b0e
1 changed files with 7 additions and 4 deletions

View File

@ -2729,8 +2729,6 @@ namespace OpenSim.Region.Framework.Scenes
if (ParentGroup == null) if (ParentGroup == null)
return; return;
ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this);
ParentGroup.QueueForUpdateCheck(); ParentGroup.QueueForUpdateCheck();
int timeNow = Util.UnixTimeSinceEpoch(); int timeNow = Util.UnixTimeSinceEpoch();
@ -2752,6 +2750,9 @@ namespace OpenSim.Region.Framework.Scenes
// m_log.DebugFormat( // m_log.DebugFormat(
// "[SCENE OBJECT PART]: Scheduling full update for {0}, {1} at {2}", // "[SCENE OBJECT PART]: Scheduling full update for {0}, {1} at {2}",
// UUID, Name, TimeStampFull); // UUID, Name, TimeStampFull);
if (ParentGroup.Scene != null)
ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this);
} }
/// <summary> /// <summary>
@ -2763,13 +2764,12 @@ namespace OpenSim.Region.Framework.Scenes
if (ParentGroup == null) if (ParentGroup == null)
return; return;
ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this);
// This was pulled from SceneViewer. Attachments always receive full updates. // This was pulled from SceneViewer. Attachments always receive full updates.
// I could not verify if this is a requirement but this maintains existing behavior // I could not verify if this is a requirement but this maintains existing behavior
if (ParentGroup.IsAttachment) if (ParentGroup.IsAttachment)
{ {
ScheduleFullUpdate(); ScheduleFullUpdate();
return;
} }
if (UpdateFlag == UpdateRequired.NONE) if (UpdateFlag == UpdateRequired.NONE)
@ -2784,6 +2784,9 @@ namespace OpenSim.Region.Framework.Scenes
// "[SCENE OBJECT PART]: Scheduling terse update for {0}, {1} at {2}", // "[SCENE OBJECT PART]: Scheduling terse update for {0}, {1} at {2}",
// UUID, Name, TimeStampTerse); // UUID, Name, TimeStampTerse);
} }
if (ParentGroup.Scene != null)
ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this);
} }
public void ScriptSetPhysicsStatus(bool UsePhysics) public void ScriptSetPhysicsStatus(bool UsePhysics)