diff options
author | MW | 2007-07-01 21:45:47 +0000 |
---|---|---|
committer | MW | 2007-07-01 21:45:47 +0000 |
commit | 7f18f494f1200f0f6470020a794e5291124f3ead (patch) | |
tree | 3807166ff2432b3b5c7d9913ecabff8103175757 /OpenSim/Region/Environment | |
parent | * removed try-catchall from scene constructor (diff) | |
download | opensim-SC_OLD-7f18f494f1200f0f6470020a794e5291124f3ead.zip opensim-SC_OLD-7f18f494f1200f0f6470020a794e5291124f3ead.tar.gz opensim-SC_OLD-7f18f494f1200f0f6470020a794e5291124f3ead.tar.bz2 opensim-SC_OLD-7f18f494f1200f0f6470020a794e5291124f3ead.tar.xz |
Just committing this because I want my commit to be on the front page of www.opensimulator.org rather than lbsa71's being there.
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Primitive.cs | 6 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObject.cs | 15 |
2 files changed, 15 insertions, 6 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Primitive.cs b/OpenSim/Region/Environment/Scenes/Primitive.cs index dd8bb02..b8ec68b 100644 --- a/OpenSim/Region/Environment/Scenes/Primitive.cs +++ b/OpenSim/Region/Environment/Scenes/Primitive.cs | |||
@@ -94,7 +94,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
94 | /// </summary> | 94 | /// </summary> |
95 | public override void update() | 95 | public override void update() |
96 | { | 96 | { |
97 | if (this.updateFlag == 1) // is a new prim just been created/reloaded | 97 | if (this.updateFlag == 1) // is a new prim just been created/reloaded or has major changes |
98 | { | 98 | { |
99 | this.SendFullUpdateToAllClients(); | 99 | this.SendFullUpdateToAllClients(); |
100 | this.updateFlag = 0; | 100 | this.updateFlag = 0; |
@@ -151,7 +151,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
151 | this.updateFlag = 1; | 151 | this.updateFlag = 1; |
152 | } | 152 | } |
153 | 153 | ||
154 | public void AddToChildren(SceneObject linkObject) | 154 | public void AddNewChildren(SceneObject linkObject) |
155 | { | 155 | { |
156 | // Console.WriteLine("linking new prims " + linkObject.rootLocalID + " to me (" + this.LocalId + ")"); | 156 | // Console.WriteLine("linking new prims " + linkObject.rootLocalID + " to me (" + this.LocalId + ")"); |
157 | //TODO check permissions | 157 | //TODO check permissions |
@@ -159,7 +159,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
159 | linkObject.rootPrimitive.SetNewParent(this, this.m_RootParent); | 159 | linkObject.rootPrimitive.SetNewParent(this, this.m_RootParent); |
160 | 160 | ||
161 | this.m_world.DeleteEntity(linkObject.rootUUID); | 161 | this.m_world.DeleteEntity(linkObject.rootUUID); |
162 | linkObject.rootPrimitive = null; | 162 | linkObject.DeleteAllChildren(); |
163 | } | 163 | } |
164 | 164 | ||
165 | public void SetNewParent(Primitive newParent, SceneObject rootParent) | 165 | public void SetNewParent(Primitive newParent, SceneObject rootParent) |
diff --git a/OpenSim/Region/Environment/Scenes/SceneObject.cs b/OpenSim/Region/Environment/Scenes/SceneObject.cs index 2c55a7d..c03354e 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObject.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObject.cs | |||
@@ -74,7 +74,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
74 | m_regionHandle = regionHandle; | 74 | m_regionHandle = regionHandle; |
75 | m_world = world; | 75 | m_world = world; |
76 | this.Pos = addPacket.ObjectData.RayEnd; | 76 | this.Pos = addPacket.ObjectData.RayEnd; |
77 | this.CreateFromPacket(addPacket, ownerID, localID); | 77 | this.CreateRootFromPacket(addPacket, ownerID, localID); |
78 | 78 | ||
79 | } | 79 | } |
80 | /// <summary> | 80 | /// <summary> |
@@ -83,7 +83,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
83 | /// <param name="addPacket"></param> | 83 | /// <param name="addPacket"></param> |
84 | /// <param name="agentID"></param> | 84 | /// <param name="agentID"></param> |
85 | /// <param name="localID"></param> | 85 | /// <param name="localID"></param> |
86 | public void CreateFromPacket(ObjectAddPacket addPacket, LLUUID agentID, uint localID) | 86 | public void CreateRootFromPacket(ObjectAddPacket addPacket, LLUUID agentID, uint localID) |
87 | { | 87 | { |
88 | this.rootPrimitive = new Primitive( this.m_regionHandle, this.m_world, addPacket, agentID, localID, true, this, this); | 88 | this.rootPrimitive = new Primitive( this.m_regionHandle, this.m_world, addPacket, agentID, localID, true, this, this); |
89 | this.children.Add(rootPrimitive); | 89 | this.children.Add(rootPrimitive); |
@@ -99,6 +99,15 @@ namespace OpenSim.Region.Environment.Scenes | |||
99 | 99 | ||
100 | } | 100 | } |
101 | 101 | ||
102 | /// <summary> | ||
103 | /// | ||
104 | /// </summary> | ||
105 | public void DeleteAllChildren() | ||
106 | { | ||
107 | this.children.Clear(); | ||
108 | this.ChildPrimitives.Clear(); | ||
109 | this.rootPrimitive = null; | ||
110 | } | ||
102 | 111 | ||
103 | /// <summary> | 112 | /// <summary> |
104 | /// | 113 | /// |
@@ -106,7 +115,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
106 | /// <param name="primObject"></param> | 115 | /// <param name="primObject"></param> |
107 | public void AddNewChildPrims(SceneObject primObject) | 116 | public void AddNewChildPrims(SceneObject primObject) |
108 | { | 117 | { |
109 | this.rootPrimitive.AddToChildren(primObject); | 118 | this.rootPrimitive.AddNewChildren(primObject); |
110 | } | 119 | } |
111 | 120 | ||
112 | /// <summary> | 121 | /// <summary> |