diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneGraph.cs | 47 |
1 files changed, 25 insertions, 22 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index a36800b..12c1c20 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -283,30 +283,33 @@ namespace OpenSim.Region.Framework.Scenes | |||
283 | protected internal bool AddRestoredSceneObject( | 283 | protected internal bool AddRestoredSceneObject( |
284 | SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted, bool sendClientUpdates) | 284 | SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted, bool sendClientUpdates) |
285 | { | 285 | { |
286 | // KF: Check for out-of-region, move inside and make static. | 286 | if (!m_parentScene.CombineRegions) |
287 | Vector3 npos = new Vector3(sceneObject.RootPart.GroupPosition.X, | 287 | { |
288 | sceneObject.RootPart.GroupPosition.Y, | 288 | // KF: Check for out-of-region, move inside and make static. |
289 | sceneObject.RootPart.GroupPosition.Z); | 289 | Vector3 npos = new Vector3(sceneObject.RootPart.GroupPosition.X, |
290 | if (!(((sceneObject.RootPart.Shape.PCode == (byte)PCode.Prim) && (sceneObject.RootPart.Shape.State != 0))) && (npos.X < 0.0 || npos.Y < 0.0 || npos.Z < 0.0 || | 290 | sceneObject.RootPart.GroupPosition.Y, |
291 | npos.X > Constants.RegionSize || | 291 | sceneObject.RootPart.GroupPosition.Z); |
292 | npos.Y > Constants.RegionSize)) | 292 | if (!(((sceneObject.RootPart.Shape.PCode == (byte)PCode.Prim) && (sceneObject.RootPart.Shape.State != 0))) && (npos.X < 0.0 || npos.Y < 0.0 || npos.Z < 0.0 || |
293 | { | 293 | npos.X > Constants.RegionSize || |
294 | if (npos.X < 0.0) npos.X = 1.0f; | 294 | npos.Y > Constants.RegionSize)) |
295 | if (npos.Y < 0.0) npos.Y = 1.0f; | ||
296 | if (npos.Z < 0.0) npos.Z = 0.0f; | ||
297 | if (npos.X > Constants.RegionSize) npos.X = Constants.RegionSize - 1.0f; | ||
298 | if (npos.Y > Constants.RegionSize) npos.Y = Constants.RegionSize - 1.0f; | ||
299 | |||
300 | foreach (SceneObjectPart part in sceneObject.Children.Values) | ||
301 | { | 295 | { |
302 | part.GroupPosition = npos; | 296 | if (npos.X < 0.0) npos.X = 1.0f; |
297 | if (npos.Y < 0.0) npos.Y = 1.0f; | ||
298 | if (npos.Z < 0.0) npos.Z = 0.0f; | ||
299 | if (npos.X > Constants.RegionSize) npos.X = Constants.RegionSize - 1.0f; | ||
300 | if (npos.Y > Constants.RegionSize) npos.Y = Constants.RegionSize - 1.0f; | ||
301 | |||
302 | foreach (SceneObjectPart part in sceneObject.Children.Values) | ||
303 | { | ||
304 | part.GroupPosition = npos; | ||
305 | } | ||
306 | sceneObject.RootPart.Velocity = Vector3.Zero; | ||
307 | sceneObject.RootPart.AngularVelocity = Vector3.Zero; | ||
308 | sceneObject.RootPart.Acceleration = Vector3.Zero; | ||
309 | sceneObject.RootPart.Velocity = Vector3.Zero; | ||
303 | } | 310 | } |
304 | sceneObject.RootPart.Velocity = Vector3.Zero; | 311 | } |
305 | sceneObject.RootPart.AngularVelocity = Vector3.Zero; | 312 | |
306 | sceneObject.RootPart.Acceleration = Vector3.Zero; | ||
307 | sceneObject.RootPart.Velocity = Vector3.Zero; | ||
308 | } | ||
309 | |||
310 | if (!alreadyPersisted) | 313 | if (!alreadyPersisted) |
311 | { | 314 | { |
312 | sceneObject.ForceInventoryPersistence(); | 315 | sceneObject.ForceInventoryPersistence(); |