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 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/Environment/Modules/World/TreePopulator') 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 +} -- cgit v1.1