From 90567a9eaac717ab86316c078e148f8fe13432ac Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 21 May 2011 00:02:53 +0100 Subject: refactor Scene.RezObject() to use AddNewSceneObject() rather than copy/pasting code with small differences --- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.Inventory.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 7b88f4f..3c47873 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -2095,19 +2095,7 @@ namespace OpenSim.Region.Framework.Scenes sourcePart.Inventory.RemoveInventoryItem(item.ItemID); } - AddNewSceneObject(group, true); - - group.AbsolutePosition = pos; - group.Velocity = vel; - - if (rot != null) - group.UpdateGroupRotationR((Quaternion)rot); - - // TODO: This needs to be refactored with the similar code in - // SceneGraph.AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup, Vector3 pos, Quaternion rot, Vector3 vel) - // possibly by allowing this method to take a null rotation. - if (group.RootPart.PhysActor != null && group.RootPart.PhysActor.IsPhysical && vel != Vector3.Zero) - group.RootPart.ApplyImpulse((vel * group.GetMass()), false); + AddNewSceneObject(group, true, pos, rot, vel); // We can only call this after adding the scene object, since the scene object references the scene // to find out if scripts should be activated at all. -- cgit v1.1