diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneGraph.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneGraph.cs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 1421d0e..3ac34d3 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -225,6 +225,30 @@ namespace OpenSim.Region.Framework.Scenes | |||
225 | protected internal bool AddRestoredSceneObject( | 225 | protected internal bool AddRestoredSceneObject( |
226 | SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted) | 226 | SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted) |
227 | { | 227 | { |
228 | // KF: Check for out-of-region, move inside and make static. | ||
229 | Vector3 npos = new Vector3(sceneObject.RootPart.GroupPosition.X, | ||
230 | sceneObject.RootPart.GroupPosition.Y, | ||
231 | sceneObject.RootPart.GroupPosition.Z); | ||
232 | 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 || | ||
233 | npos.X > Constants.RegionSize || | ||
234 | npos.Y > Constants.RegionSize)) | ||
235 | { | ||
236 | if (npos.X < 0.0) npos.X = 1.0f; | ||
237 | if (npos.Y < 0.0) npos.Y = 1.0f; | ||
238 | if (npos.Z < 0.0) npos.Z = 0.0f; | ||
239 | if (npos.X > Constants.RegionSize) npos.X = Constants.RegionSize - 1.0f; | ||
240 | if (npos.Y > Constants.RegionSize) npos.Y = Constants.RegionSize - 1.0f; | ||
241 | |||
242 | foreach (SceneObjectPart part in sceneObject.Children.Values) | ||
243 | { | ||
244 | part.GroupPosition = npos; | ||
245 | } | ||
246 | sceneObject.RootPart.Velocity = Vector3.Zero; | ||
247 | sceneObject.RootPart.AngularVelocity = Vector3.Zero; | ||
248 | sceneObject.RootPart.Acceleration = Vector3.Zero; | ||
249 | sceneObject.RootPart.Velocity = Vector3.Zero; | ||
250 | } | ||
251 | |||
228 | if (!alreadyPersisted) | 252 | if (!alreadyPersisted) |
229 | { | 253 | { |
230 | sceneObject.ForceInventoryPersistence(); | 254 | sceneObject.ForceInventoryPersistence(); |