From 25b4e268a3cb48e3b9c85dfe7887bb1fbbdb0a1c Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 8 Sep 2014 11:16:59 +0100 Subject: change attachment drop, to make object Phanton. THis is not as SL, but rez position is automatic and object interpenetrations will happen including with the avatar, with the usual ugly effects. --- .../Avatar/Attachments/AttachmentsModule.cs | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 0361741..414bae6 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs @@ -701,28 +701,31 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments sp.RemoveAttachment(so); so.FromItemID = UUID.Zero; + so.AttachedAvatar = UUID.Zero; + so.ClearPartAttachmentData(); + SceneObjectPart rootPart = so.RootPart; + + rootPart.SetParentLocalId(0); so.AbsolutePosition = absolutePos; if (absoluteRot != Quaternion.Identity) { so.UpdateGroupRotationR(absoluteRot); } - so.AttachedAvatar = UUID.Zero; - rootPart.SetParentLocalId(0); - so.ClearPartAttachmentData(); - rootPart.Flags &= ~PrimFlags.Phantom; +// rootPart.RemFlag(PrimFlags.TemporaryOnRez); +// rootPart.AddFlag(PrimFlags.Phantom); + // rootPart.ApplyPhysics(rootPart.GetEffectiveObjectFlags(), rootPart.VolumeDetectActive,false); - so.ApplyPhysics(); + + // not physical, not temporary, phaton, not volume detector + so.UpdatePrimFlags(rootPart.LocalId,false,false,true,false); so.HasGroupChanged = true; rootPart.Rezzed = DateTime.Now; - rootPart.RemFlag(PrimFlags.TemporaryOnRez); so.AttachToBackup(); m_scene.EventManager.TriggerParcelPrimCountTainted(); - so.ScheduleGroupForFullUpdate(); - rootPart.ClearUndoState(); List uuids = new List(); @@ -735,6 +738,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments // Attach (NULL) stops scripts. We don't want that. Resume them. so.ResumeScripts(); + so.ScheduleGroupForFullUpdate(); } public void DetachSingleAttachmentToInv(IScenePresence sp, SceneObjectGroup so) -- cgit v1.1