aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/World/TreePopulator
diff options
context:
space:
mode:
authorMelanie Thielker2008-08-14 21:31:38 +0000
committerMelanie Thielker2008-08-14 21:31:38 +0000
commit4041194db93c1687c6d9f40744b27b037934ad16 (patch)
treeac8d01fd86618b93f267cee25cd8e56040b4c5d5 /OpenSim/Region/Environment/Modules/World/TreePopulator
parentAdds UserFlags and GodLevel to the user data store and plumbs then in. (diff)
downloadopensim-SC_OLD-4041194db93c1687c6d9f40744b27b037934ad16.zip
opensim-SC_OLD-4041194db93c1687c6d9f40744b27b037934ad16.tar.gz
opensim-SC_OLD-4041194db93c1687c6d9f40744b27b037934ad16.tar.bz2
opensim-SC_OLD-4041194db93c1687c6d9f40744b27b037934ad16.tar.xz
Refactor: Make the tree creation function take a UUID for the owner
Change the tree populator module to supply a sensible value
Diffstat (limited to 'OpenSim/Region/Environment/Modules/World/TreePopulator')
-rw-r--r--OpenSim/Region/Environment/Modules/World/TreePopulator/TreePopulatorModule.cs17
1 files changed, 12 insertions, 5 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/TreePopulator/TreePopulatorModule.cs b/OpenSim/Region/Environment/Modules/World/TreePopulator/TreePopulatorModule.cs
index fc3b9dd..cb69b47 100644
--- a/OpenSim/Region/Environment/Modules/World/TreePopulator/TreePopulatorModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/TreePopulator/TreePopulatorModule.cs
@@ -98,8 +98,11 @@ namespace OpenSim.Region.Environment.Modules.World.TreePopulator
98 { 98 {
99 if (args[0] == "tree") 99 if (args[0] == "tree")
100 { 100 {
101 LLUUID uuid = m_scene.RegionInfo.EstateSettings.EstateOwner;
102 if(uuid == LLUUID.Zero)
103 uuid = m_scene.RegionInfo.MasterAvatarAssignedUUID;
101 m_log.Debug("[TREES]: New tree planting"); 104 m_log.Debug("[TREES]: New tree planting");
102 CreateTree(new LLVector3(128.0f, 128.0f, 0.0f)); 105 CreateTree(uuid, new LLVector3(128.0f, 128.0f, 0.0f));
103 } 106 }
104 } 107 }
105 108
@@ -220,15 +223,19 @@ namespace OpenSim.Region.Environment.Modules.World.TreePopulator
220 position.X += (float) randX; 223 position.X += (float) randX;
221 position.Y += (float) randY; 224 position.Y += (float) randY;
222 225
223 CreateTree(position); 226 LLUUID uuid = m_scene.RegionInfo.EstateSettings.EstateOwner;
227 if(uuid == LLUUID.Zero)
228 uuid = m_scene.RegionInfo.MasterAvatarAssignedUUID;
229
230 CreateTree(uuid, position);
224 } 231 }
225 232
226 private void CreateTree(LLVector3 position) 233 private void CreateTree(LLUUID uuid, LLVector3 position)
227 { 234 {
228 position.Z = (float) m_scene.Heightmap[(int) position.X, (int) position.Y]; 235 position.Z = (float) m_scene.Heightmap[(int) position.X, (int) position.Y];
229 236
230 SceneObjectGroup tree = 237 SceneObjectGroup tree =
231 m_scene.AddTree(new LLVector3(0.1f, 0.1f, 0.1f), 238 m_scene.AddTree(uuid, new LLVector3(0.1f, 0.1f, 0.1f),
232 LLQuaternion.Identity, 239 LLQuaternion.Identity,
233 position, 240 position,
234 Tree.Cypress1, 241 Tree.Cypress1,
@@ -245,4 +252,4 @@ namespace OpenSim.Region.Environment.Modules.World.TreePopulator
245 killTrees(); 252 killTrees();
246 } 253 }
247 } 254 }
248} \ No newline at end of file 255}