From 09aa87ba262037d3edb6419ed59f66e7f3a90aa2 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Thu, 15 Nov 2012 02:38:57 +0000 Subject: [PATCH] Fix SceneObjectUndoRedoTests.TestNoUndoOnObjectsNotInScene by not looking up ParentGroup scale limits if part is not in a sog --- .../Framework/Scenes/SceneObjectPart.cs | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 82fa5a1821..337bf73174 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -2368,17 +2368,20 @@ namespace OpenSim.Region.Framework.Scenes /// public void Resize(Vector3 scale) { - scale.X = Math.Min(scale.X, ParentGroup.Scene.m_maxNonphys); - scale.Y = Math.Min(scale.Y, ParentGroup.Scene.m_maxNonphys); - scale.Z = Math.Min(scale.Z, ParentGroup.Scene.m_maxNonphys); + if (ParentGroup.Scene != null) + { + scale.X = Math.Min(scale.X, ParentGroup.Scene.m_maxNonphys); + scale.Y = Math.Min(scale.Y, ParentGroup.Scene.m_maxNonphys); + scale.Z = Math.Min(scale.Z, ParentGroup.Scene.m_maxNonphys); - PhysicsActor pa = PhysActor; + PhysicsActor pa = PhysActor; - if (pa != null && pa.IsPhysical) - { - scale.X = Math.Min(scale.X, ParentGroup.Scene.m_maxPhys); - scale.Y = Math.Min(scale.Y, ParentGroup.Scene.m_maxPhys); - scale.Z = Math.Min(scale.Z, ParentGroup.Scene.m_maxPhys); + if (pa != null && pa.IsPhysical) + { + scale.X = Math.Min(scale.X, ParentGroup.Scene.m_maxPhys); + scale.Y = Math.Min(scale.Y, ParentGroup.Scene.m_maxPhys); + scale.Z = Math.Min(scale.Z, ParentGroup.Scene.m_maxPhys); + } } // m_log.DebugFormat("[SCENE OBJECT PART]: Resizing {0} {1} to {2}", Name, LocalId, scale);