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