diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs b/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs index 3f5d375..4cee7a5 100644 --- a/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs +++ b/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs | |||
@@ -39,14 +39,14 @@ namespace OpenSim.Region.CoreModules.World.Vegetation | |||
39 | { | 39 | { |
40 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "VegetationModule")] | 40 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "VegetationModule")] |
41 | public class VegetationModule : INonSharedRegionModule, IVegetationModule | 41 | public class VegetationModule : INonSharedRegionModule, IVegetationModule |
42 | { | 42 | { |
43 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 43 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
44 | 44 | ||
45 | protected Scene m_scene; | 45 | protected Scene m_scene; |
46 | 46 | ||
47 | protected static readonly PCode[] creationCapabilities = new PCode[] { PCode.Grass, PCode.NewTree, PCode.Tree }; | 47 | protected static readonly PCode[] creationCapabilities = new PCode[] { PCode.Grass, PCode.NewTree, PCode.Tree }; |
48 | public PCode[] CreationCapabilities { get { return creationCapabilities; } } | 48 | public PCode[] CreationCapabilities { get { return creationCapabilities; } } |
49 | 49 | ||
50 | public void Initialise(IConfigSource source) | 50 | public void Initialise(IConfigSource source) |
51 | { | 51 | { |
52 | } | 52 | } |
@@ -83,10 +83,10 @@ namespace OpenSim.Region.CoreModules.World.Vegetation | |||
83 | treeShape.PCode = newTree ? (byte)PCode.NewTree : (byte)PCode.Tree; | 83 | treeShape.PCode = newTree ? (byte)PCode.NewTree : (byte)PCode.Tree; |
84 | treeShape.Scale = scale; | 84 | treeShape.Scale = scale; |
85 | treeShape.State = (byte)treeType; | 85 | treeShape.State = (byte)treeType; |
86 | 86 | ||
87 | return m_scene.AddNewPrim(uuid, groupID, position, rotation, treeShape); | 87 | return m_scene.AddNewPrim(uuid, groupID, position, rotation, treeShape); |
88 | } | 88 | } |
89 | 89 | ||
90 | public SceneObjectGroup CreateEntity( | 90 | public SceneObjectGroup CreateEntity( |
91 | UUID ownerID, UUID groupID, Vector3 pos, Quaternion rot, PrimitiveBaseShape shape) | 91 | UUID ownerID, UUID groupID, Vector3 pos, Quaternion rot, PrimitiveBaseShape shape) |
92 | { | 92 | { |
@@ -95,22 +95,23 @@ namespace OpenSim.Region.CoreModules.World.Vegetation | |||
95 | m_log.DebugFormat("[VEGETATION]: PCode {0} not handled by {1}", shape.PCode, Name); | 95 | m_log.DebugFormat("[VEGETATION]: PCode {0} not handled by {1}", shape.PCode, Name); |
96 | return null; | 96 | return null; |
97 | } | 97 | } |
98 | 98 | ||
99 | SceneObjectGroup sceneObject = new SceneObjectGroup(ownerID, pos, rot, shape); | 99 | SceneObjectGroup sceneObject = new SceneObjectGroup(ownerID, pos, rot, shape); |
100 | SceneObjectPart rootPart = sceneObject.GetPart(sceneObject.UUID); | 100 | SceneObjectPart rootPart = sceneObject.GetPart(sceneObject.UUID); |
101 | 101 | ||
102 | // if grass or tree, make phantom | 102 | // if grass or tree, make phantom |
103 | //rootPart.TrimPermissions(); | 103 | //rootPart.TrimPermissions(); |
104 | rootPart.AddFlag(PrimFlags.Phantom); | 104 | rootPart.AddFlag(PrimFlags.Phantom); |
105 | if (rootPart.Shape.PCode != (byte)PCode.Grass) | 105 | if (rootPart.Shape.PCode != (byte)PCode.Grass) |
106 | AdaptTree(ref shape); | 106 | AdaptTree(ref shape); |
107 | 107 | ||
108 | m_scene.AddNewSceneObject(sceneObject, true); | ||
109 | sceneObject.SetGroup(groupID, null); | 108 | sceneObject.SetGroup(groupID, null); |
110 | 109 | m_scene.AddNewSceneObject(sceneObject, true); | |
110 | sceneObject.InvalidateDeepEffectivePerms(); | ||
111 | |||
111 | return sceneObject; | 112 | return sceneObject; |
112 | } | 113 | } |
113 | 114 | ||
114 | protected void AdaptTree(ref PrimitiveBaseShape tree) | 115 | protected void AdaptTree(ref PrimitiveBaseShape tree) |
115 | { | 116 | { |
116 | // Tree size has to be adapted depending on its type | 117 | // Tree size has to be adapted depending on its type |