diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/InnerScene.cs | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs index 2aa51b8..cbe5798 100644 --- a/OpenSim/Region/Environment/Scenes/InnerScene.cs +++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs | |||
@@ -310,13 +310,22 @@ namespace OpenSim.Region.Environment.Scenes | |||
310 | } | 310 | } |
311 | 311 | ||
312 | } | 312 | } |
313 | /// <summary> | ||
314 | /// Event Handling routine for Attach Object | ||
315 | /// </summary> | ||
316 | /// <param name="remoteClient"></param> | ||
317 | /// <param name="objectLocalID"></param> | ||
318 | /// <param name="AttachmentPt"></param> | ||
319 | /// <param name="rot"></param> | ||
313 | public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, LLQuaternion rot) | 320 | public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, LLQuaternion rot) |
314 | { | 321 | { |
315 | List<EntityBase> EntityList = GetEntities(); | 322 | // Calls attach with a Zero position |
316 | 323 | AttachObject(remoteClient, objectLocalID, AttachmentPt, rot, LLVector3.Zero); | |
317 | if (AttachmentPt == 0) | 324 | } |
318 | AttachmentPt = (uint)AttachmentPoint.LeftHand; | ||
319 | 325 | ||
326 | public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, LLQuaternion rot, LLVector3 attachPos) | ||
327 | { | ||
328 | List<EntityBase> EntityList = GetEntities(); | ||
320 | foreach (EntityBase obj in EntityList) | 329 | foreach (EntityBase obj in EntityList) |
321 | { | 330 | { |
322 | if (obj is SceneObjectGroup) | 331 | if (obj is SceneObjectGroup) |
@@ -324,7 +333,20 @@ namespace OpenSim.Region.Environment.Scenes | |||
324 | if (((SceneObjectGroup)obj).LocalId == objectLocalID) | 333 | if (((SceneObjectGroup)obj).LocalId == objectLocalID) |
325 | { | 334 | { |
326 | SceneObjectGroup group = (SceneObjectGroup)obj; | 335 | SceneObjectGroup group = (SceneObjectGroup)obj; |
327 | group.AttachToAgent(remoteClient.AgentId, AttachmentPt); | 336 | if (AttachmentPt == 0) |
337 | { | ||
338 | // Check object for stored attachment point | ||
339 | AttachmentPt = (uint)group.GetAttachmentPoint(); | ||
340 | |||
341 | // if we still didn't find a suitable attachment point....... | ||
342 | if (AttachmentPt == 0) | ||
343 | { | ||
344 | AttachmentPt = (uint)AttachmentPoint.LeftHand; | ||
345 | } | ||
346 | |||
347 | } | ||
348 | |||
349 | group.AttachToAgent(remoteClient.AgentId, AttachmentPt, attachPos); | ||
328 | 350 | ||
329 | } | 351 | } |
330 | 352 | ||