Refactor: Make the tree creation function take a UUID for the owner

Change the tree populator module to supply a sensible value
0.6.0-stable
Melanie Thielker 2008-08-14 21:31:38 +00:00
parent 7161689a97
commit 4041194db9
2 changed files with 13 additions and 7 deletions

View File

@ -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();
}
}
}
}

View File

@ -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;