Refactor: Make the tree creation function take a UUID for the owner
Change the tree populator module to supply a sensible value0.6.0-stable
parent
7161689a97
commit
4041194db9
|
@ -98,8 +98,11 @@ namespace OpenSim.Region.Environment.Modules.World.TreePopulator
|
||||||
{
|
{
|
||||||
if (args[0] == "tree")
|
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");
|
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.X += (float) randX;
|
||||||
position.Y += (float) randY;
|
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];
|
position.Z = (float) m_scene.Heightmap[(int) position.X, (int) position.Y];
|
||||||
|
|
||||||
SceneObjectGroup tree =
|
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,
|
LLQuaternion.Identity,
|
||||||
position,
|
position,
|
||||||
Tree.Cypress1,
|
Tree.Cypress1,
|
||||||
|
|
|
@ -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)
|
Tree treeType, bool newTree)
|
||||||
{
|
{
|
||||||
LLUUID uuid = this.RegionInfo.MasterAvatarAssignedUUID;
|
|
||||||
PrimitiveBaseShape treeShape = new PrimitiveBaseShape();
|
PrimitiveBaseShape treeShape = new PrimitiveBaseShape();
|
||||||
treeShape.PathCurve = 16;
|
treeShape.PathCurve = 16;
|
||||||
treeShape.PathEnd = 49900;
|
treeShape.PathEnd = 49900;
|
||||||
|
|
Loading…
Reference in New Issue