From 4041194db93c1687c6d9f40744b27b037934ad16 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Thu, 14 Aug 2008 21:31:38 +0000 Subject: Refactor: Make the tree creation function take a UUID for the owner Change the tree populator module to supply a sensible value --- .../Modules/World/TreePopulator/TreePopulatorModule.cs | 17 ++++++++++++----- OpenSim/Region/Environment/Scenes/Scene.cs | 3 +-- 2 files changed, 13 insertions(+), 7 deletions(-) (limited to 'OpenSim/Region') 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 { if (args[0] == "tree") { + LLUUID uuid = m_scene.RegionInfo.EstateSettings.EstateOwner; + if(uuid == LLUUID.Zero) + uuid = m_scene.RegionInfo.MasterAvatarAssignedUUID; m_log.Debug("[TREES]: New tree planting"); - CreateTree(new LLVector3(128.0f, 128.0f, 0.0f)); + CreateTree(uuid, new LLVector3(128.0f, 128.0f, 0.0f)); } } @@ -220,15 +223,19 @@ namespace OpenSim.Region.Environment.Modules.World.TreePopulator position.X += (float) randX; position.Y += (float) randY; - CreateTree(position); + LLUUID uuid = m_scene.RegionInfo.EstateSettings.EstateOwner; + if(uuid == LLUUID.Zero) + uuid = m_scene.RegionInfo.MasterAvatarAssignedUUID; + + CreateTree(uuid, position); } - private void CreateTree(LLVector3 position) + private void CreateTree(LLUUID uuid, LLVector3 position) { position.Z = (float) m_scene.Heightmap[(int) position.X, (int) position.Y]; SceneObjectGroup tree = - m_scene.AddTree(new LLVector3(0.1f, 0.1f, 0.1f), + m_scene.AddTree(uuid, new LLVector3(0.1f, 0.1f, 0.1f), LLQuaternion.Identity, position, Tree.Cypress1, @@ -245,4 +252,4 @@ namespace OpenSim.Region.Environment.Modules.World.TreePopulator killTrees(); } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index b4bb2f6..bd02b7e 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -1635,10 +1635,9 @@ namespace OpenSim.Region.Environment.Scenes } } - public SceneObjectGroup AddTree(LLVector3 scale, LLQuaternion rotation, LLVector3 position, + public SceneObjectGroup AddTree(LLUUID uuid, LLVector3 scale, LLQuaternion rotation, LLVector3 position, Tree treeType, bool newTree) { - LLUUID uuid = this.RegionInfo.MasterAvatarAssignedUUID; PrimitiveBaseShape treeShape = new PrimitiveBaseShape(); treeShape.PathCurve = 16; treeShape.PathEnd = 49900; -- cgit v1.1