aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs32
1 files changed, 29 insertions, 3 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index ba57115..1e69c9e 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -155,7 +155,7 @@ namespace OpenSim.Region.Environment.Scenes
155 List<SceneObject> PrimsFromDB = storageManager.DataStore.LoadObjects(); 155 List<SceneObject> PrimsFromDB = storageManager.DataStore.LoadObjects();
156 foreach (SceneObject prim in PrimsFromDB) 156 foreach (SceneObject prim in PrimsFromDB)
157 { 157 {
158 Prims.Add(prim.uuid, prim); 158 AddEntity(prim);
159 } 159 }
160 MainLog.Instance.Verbose("World.cs - loaded " + PrimsFromDB.Count.ToString() + " object(s)"); 160 MainLog.Instance.Verbose("World.cs - loaded " + PrimsFromDB.Count.ToString() + " object(s)");
161 161
@@ -483,14 +483,40 @@ namespace OpenSim.Region.Environment.Scenes
483 { 483 {
484 484
485 SceneObject sceneOb = new SceneObject(this, m_eventManager, ownerID, this.PrimIDAllocate(), pos, shape); 485 SceneObject sceneOb = new SceneObject(this, m_eventManager, ownerID, this.PrimIDAllocate(), pos, shape);
486 AddNewEntity(sceneOb); 486 AddEntity(sceneOb);
487 } 487 }
488 488
489 public void AddNewEntity(SceneObject sceneObject) 489 public void RemovePrim(uint localID, LLUUID avatar_deleter)
490 {
491 foreach (EntityBase obj in Entities.Values)
492 {
493 if (obj is SceneObject)
494 {
495 if (((SceneObject)obj).LocalId == localID)
496 {
497 RemoveEntity((SceneObject)obj);
498 return;
499 }
500 }
501 }
502
503 }
504
505 public void AddEntity(SceneObject sceneObject)
490 { 506 {
491 this.Entities.Add(sceneObject.rootUUID, sceneObject); 507 this.Entities.Add(sceneObject.rootUUID, sceneObject);
492 } 508 }
493 509
510 public void RemoveEntity(SceneObject sceneObject)
511 {
512 if (this.Entities.ContainsKey(sceneObject.rootUUID))
513 {
514 m_parcelManager.removePrimFromParcelCounts(sceneObject);
515 this.Entities.Remove(sceneObject.rootUUID);
516 m_parcelManager.setPrimsTainted();
517 }
518 }
519
494 /// <summary> 520 /// <summary>
495 /// Called by a prim when it has been created/cloned, so that its events can be subscribed to 521 /// Called by a prim when it has been created/cloned, so that its events can be subscribed to
496 /// </summary> 522 /// </summary>