refactor: move SOP.IsAttachment and AttachmentPoint up into SOG to avoid pointless duplication of identical values

This commit is contained in:
Justin Clark-Casey (justincc)
2011-08-27 00:15:21 +01:00
parent 15a514fcbc
commit 33a894f3d2
16 changed files with 83 additions and 113 deletions

View File

@@ -330,7 +330,7 @@ namespace OpenSim.Region.ClientStack.Linden
grp.AbsolutePosition = obj.Position;
prim.RotationOffset = obj.Rotation;
grp.RootPart.IsAttachment = false;
grp.IsAttachment = false;
// Required for linking
grp.RootPart.UpdateFlag = 0;

View File

@@ -4756,7 +4756,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
SceneObjectPart part = (SceneObjectPart)entity;
attachPoint = part.AttachmentPoint;
if (part.ParentGroup != null)
attachPoint = part.ParentGroup.AttachmentPoint;
else
attachPoint = 0;
collisionPlane = Vector4.Zero;
position = part.RelativePosition;
velocity = part.Velocity;
@@ -4913,10 +4917,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
//update.JointType = 0;
update.Material = data.Material;
update.MediaURL = Utils.EmptyBytes; // FIXME: Support this in OpenSim
if (data.IsAttachment)
if (data.ParentGroup != null && data.ParentGroup.IsAttachment)
{
update.NameValue = Util.StringToBytes256("AttachItemID STRING RW SV " + data.FromItemID);
update.State = (byte)((data.AttachmentPoint % 16) * 16 + (data.AttachmentPoint / 16));
update.State = (byte)((data.ParentGroup.AttachmentPoint % 16) * 16 + (data.ParentGroup.AttachmentPoint / 16));
}
else
{