* Ooops, attachments now teleport/cross region borders along with your avatar. Those dastardly objects stick to you.

This commit is contained in:
Teravus Ovares
2008-04-26 17:36:30 +00:00
parent 3dc60c1433
commit 323038ceb9
6 changed files with 141 additions and 22 deletions

View File

@@ -310,13 +310,22 @@ namespace OpenSim.Region.Environment.Scenes
}
}
/// <summary>
/// Event Handling routine for Attach Object
/// </summary>
/// <param name="remoteClient"></param>
/// <param name="objectLocalID"></param>
/// <param name="AttachmentPt"></param>
/// <param name="rot"></param>
public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, LLQuaternion rot)
{
// Calls attach with a Zero position
AttachObject(remoteClient, objectLocalID, AttachmentPt, rot, LLVector3.Zero);
}
public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, LLQuaternion rot, LLVector3 attachPos)
{
List<EntityBase> EntityList = GetEntities();
if (AttachmentPt == 0)
AttachmentPt = (uint)AttachmentPoint.LeftHand;
foreach (EntityBase obj in EntityList)
{
if (obj is SceneObjectGroup)
@@ -324,7 +333,20 @@ namespace OpenSim.Region.Environment.Scenes
if (((SceneObjectGroup)obj).LocalId == objectLocalID)
{
SceneObjectGroup group = (SceneObjectGroup)obj;
group.AttachToAgent(remoteClient.AgentId, AttachmentPt);
if (AttachmentPt == 0)
{
// Check object for stored attachment point
AttachmentPt = (uint)group.GetAttachmentPoint();
// if we still didn't find a suitable attachment point.......
if (AttachmentPt == 0)
{
AttachmentPt = (uint)AttachmentPoint.LeftHand;
}
}
group.AttachToAgent(remoteClient.AgentId, AttachmentPt, attachPos);
}