aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs43
1 files changed, 34 insertions, 9 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index df6a1cf..b7c5b6b 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2078,7 +2078,7 @@ namespace OpenSim.Region.Framework.Scenes
2078 2078
2079 Scene.ForEachScenePresence(delegate(ScenePresence avatar) 2079 Scene.ForEachScenePresence(delegate(ScenePresence avatar)
2080 { 2080 {
2081 if (!avatar.IsChildAgent && avatar.ParentID == LocalId) 2081 if (!avatar.IsChildAgent && avatar.ParentID == part.LocalId && avatar.ParentUUID == UUID.Zero)
2082 avatar.StandUp(); 2082 avatar.StandUp();
2083 2083
2084 if (!silent) 2084 if (!silent)
@@ -2092,6 +2092,8 @@ namespace OpenSim.Region.Framework.Scenes
2092 { 2092 {
2093 // Send a kill object immediately 2093 // Send a kill object immediately
2094 avatar.ControllingClient.SendKillObject(new List<uint> { part.LocalId }); 2094 avatar.ControllingClient.SendKillObject(new List<uint> { part.LocalId });
2095 //direct enqueue another delayed kill
2096 avatar.ControllingClient.SendEntityUpdate(part,PrimUpdateFlags.Kill);
2095 } 2097 }
2096 } 2098 }
2097 } 2099 }
@@ -2110,6 +2112,12 @@ namespace OpenSim.Region.Framework.Scenes
2110 d.AddActiveScripts(count); 2112 d.AddActiveScripts(count);
2111 } 2113 }
2112 2114
2115 private const scriptEvents PhysicsNeeedSubsEvents = (
2116 scriptEvents.collision | scriptEvents.collision_start | scriptEvents.collision_end |
2117 scriptEvents.land_collision | scriptEvents.land_collision_start | scriptEvents.land_collision_end);
2118
2119 private scriptEvents lastRootPartPhysEvents = 0;
2120
2113 public void aggregateScriptEvents() 2121 public void aggregateScriptEvents()
2114 { 2122 {
2115 PrimFlags objectflagupdate = (PrimFlags)RootPart.GetEffectiveObjectFlags(); 2123 PrimFlags objectflagupdate = (PrimFlags)RootPart.GetEffectiveObjectFlags();
@@ -2146,6 +2154,20 @@ namespace OpenSim.Region.Framework.Scenes
2146 m_scene.RemoveGroupTarget(this); 2154 m_scene.RemoveGroupTarget(this);
2147 } 2155 }
2148 2156
2157 scriptEvents rootPartPhysEvents = RootPart.AggregateScriptEvents;
2158 rootPartPhysEvents &= PhysicsNeeedSubsEvents;
2159 if (rootPartPhysEvents != lastRootPartPhysEvents)
2160 {
2161 lastRootPartPhysEvents = rootPartPhysEvents;
2162 for (int i = 0; i < parts.Length; i++)
2163 {
2164 SceneObjectPart part = parts[i];
2165 if (part == null)
2166 continue;
2167 part.UpdatePhysicsSubscribedEvents();
2168 }
2169 }
2170
2149 ScheduleGroupForFullUpdate(); 2171 ScheduleGroupForFullUpdate();
2150 } 2172 }
2151 2173
@@ -2174,7 +2196,6 @@ namespace OpenSim.Region.Framework.Scenes
2174 // Apply physics to the root prim 2196 // Apply physics to the root prim
2175 m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive, true); 2197 m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive, true);
2176 2198
2177
2178 for (int i = 0; i < parts.Length; i++) 2199 for (int i = 0; i < parts.Length; i++)
2179 { 2200 {
2180 SceneObjectPart part = parts[i]; 2201 SceneObjectPart part = parts[i];
@@ -2242,10 +2263,10 @@ namespace OpenSim.Region.Framework.Scenes
2242 // any exception propogate upwards. 2263 // any exception propogate upwards.
2243 try 2264 try
2244 { 2265 {
2245 if (!m_scene.ShuttingDown || // if shutting down then there will be nothing to handle the return so leave till next restart 2266 // if shutting down then there will be nothing to handle the return so leave till next restart
2246 !m_scene.LoginsEnabled || // We're starting up or doing maintenance, don't mess with things 2267 if (!m_scene.ShuttingDown &&
2247 m_scene.LoadingPrims) // Land may not be valid yet 2268 m_scene.LoginsEnabled && // We're starting up or doing maintenance, don't mess with things
2248 2269 !m_scene.LoadingPrims) // Land may not be valid yet
2249 { 2270 {
2250 ILandObject parcel = m_scene.LandChannel.GetLandObject( 2271 ILandObject parcel = m_scene.LandChannel.GetLandObject(
2251 m_rootPart.GroupPosition.X, m_rootPart.GroupPosition.Y); 2272 m_rootPart.GroupPosition.X, m_rootPart.GroupPosition.Y);
@@ -3345,7 +3366,10 @@ namespace OpenSim.Region.Framework.Scenes
3345 // engine about the delink. Someday, linksets should be made first 3366 // engine about the delink. Someday, linksets should be made first
3346 // class objects in the physics engine interface). 3367 // class objects in the physics engine interface).
3347 if (linkPartPa != null) 3368 if (linkPartPa != null)
3369 {
3348 m_scene.PhysicsScene.RemovePrim(linkPartPa); 3370 m_scene.PhysicsScene.RemovePrim(linkPartPa);
3371 linkPart.PhysActor = null;
3372 }
3349 3373
3350 // We need to reset the child part's position 3374 // We need to reset the child part's position
3351 // ready for life as a separate object after being a part of another object 3375 // ready for life as a separate object after being a part of another object
@@ -3397,10 +3421,11 @@ namespace OpenSim.Region.Framework.Scenes
3397 public virtual void DetachFromBackup() 3421 public virtual void DetachFromBackup()
3398 { 3422 {
3399 if (m_scene != null) 3423 if (m_scene != null)
3424 {
3400 m_scene.SceneGraph.FireDetachFromBackup(this); 3425 m_scene.SceneGraph.FireDetachFromBackup(this);
3401 if (Backup && Scene != null) 3426 if (Backup)
3402 m_scene.EventManager.OnBackup -= ProcessBackup; 3427 m_scene.EventManager.OnBackup -= ProcessBackup;
3403 3428 }
3404 Backup = false; 3429 Backup = false;
3405 } 3430 }
3406 3431