diff options
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/InnerScene.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/InnerScene.cs | 69 |
1 files changed, 38 insertions, 31 deletions
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs index 9d4119d..7ffddb3 100644 --- a/OpenSim/Region/Environment/Scenes/InnerScene.cs +++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs | |||
@@ -338,6 +338,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
338 | public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, LLQuaternion rot) | 338 | public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, LLQuaternion rot) |
339 | { | 339 | { |
340 | // Calls attach with a Zero position | 340 | // Calls attach with a Zero position |
341 | |||
341 | AttachObject(remoteClient, objectLocalID, AttachmentPt, rot, LLVector3.Zero); | 342 | AttachObject(remoteClient, objectLocalID, AttachmentPt, rot, LLVector3.Zero); |
342 | } | 343 | } |
343 | public void RezSingleAttachment(IClientAPI remoteClient, LLUUID itemID, uint AttachmentPt,uint ItemFlags, uint NextOwnerMask) | 344 | public void RezSingleAttachment(IClientAPI remoteClient, LLUUID itemID, uint AttachmentPt,uint ItemFlags, uint NextOwnerMask) |
@@ -393,46 +394,52 @@ namespace OpenSim.Region.Environment.Scenes | |||
393 | if (((SceneObjectGroup)obj).LocalId == objectLocalID) | 394 | if (((SceneObjectGroup)obj).LocalId == objectLocalID) |
394 | { | 395 | { |
395 | SceneObjectGroup group = (SceneObjectGroup)obj; | 396 | SceneObjectGroup group = (SceneObjectGroup)obj; |
396 | 397 | if (m_parentScene.Permissions.CanEditObject(remoteClient.AgentId, obj.UUID)) | |
397 | // If the attachment point isn't the same as the one previously used | ||
398 | // set it's offset position = 0 so that it appears on the attachment point | ||
399 | // and not in a weird location somewhere unknown. | ||
400 | if (AttachmentPt != 0 && AttachmentPt != (uint)group.GetAttachmentPoint()) | ||
401 | { | 398 | { |
399 | // If the attachment point isn't the same as the one previously used | ||
400 | // set it's offset position = 0 so that it appears on the attachment point | ||
401 | // and not in a weird location somewhere unknown. | ||
402 | if (AttachmentPt != 0 && AttachmentPt != (uint)group.GetAttachmentPoint()) | ||
403 | { | ||
402 | 404 | ||
403 | attachPos = LLVector3.Zero; | 405 | attachPos = LLVector3.Zero; |
404 | } | 406 | } |
405 | 407 | ||
406 | // AttachmentPt 0 means the client chose to 'wear' the attachment. | 408 | // AttachmentPt 0 means the client chose to 'wear' the attachment. |
407 | if (AttachmentPt == 0) | 409 | if (AttachmentPt == 0) |
408 | { | 410 | { |
409 | |||
410 | // Check object for stored attachment point | ||
411 | AttachmentPt = (uint)group.GetAttachmentPoint(); | ||
412 | |||
413 | 411 | ||
414 | } | 412 | // Check object for stored attachment point |
413 | AttachmentPt = (uint)group.GetAttachmentPoint(); | ||
415 | 414 | ||
416 | // if we still didn't find a suitable attachment point....... | 415 | |
417 | if (AttachmentPt == 0) | 416 | } |
418 | { | 417 | |
419 | // Stick it on left hand with Zero Offset from the attachment point. | 418 | // if we still didn't find a suitable attachment point....... |
420 | AttachmentPt = (uint)AttachmentPoint.LeftHand; | 419 | if (AttachmentPt == 0) |
421 | attachPos = LLVector3.Zero; | 420 | { |
422 | } | 421 | // Stick it on left hand with Zero Offset from the attachment point. |
422 | AttachmentPt = (uint)AttachmentPoint.LeftHand; | ||
423 | attachPos = LLVector3.Zero; | ||
424 | } | ||
423 | m_log.Debug("[ATTACH]: Using attachpoint: " + AttachmentPt.ToString()); | 425 | m_log.Debug("[ATTACH]: Using attachpoint: " + AttachmentPt.ToString()); |
424 | |||
425 | |||
426 | 426 | ||
427 | // Saves and gets assetID | ||
428 | if (group.GetFromAssetID() == LLUUID.Zero) | ||
429 | { | ||
430 | LLUUID newAssetID = m_parentScene.attachObjectAssetStore(remoteClient, group, remoteClient.AgentId); | ||
431 | 427 | ||
432 | // sets assetID so client can show asset as 'attached' in inventory | 428 | |
433 | group.SetFromAssetID(newAssetID); | 429 | // Saves and gets assetID |
430 | if (group.GetFromAssetID() == LLUUID.Zero) | ||
431 | { | ||
432 | LLUUID newAssetID = m_parentScene.attachObjectAssetStore(remoteClient, group, remoteClient.AgentId); | ||
433 | |||
434 | // sets assetID so client can show asset as 'attached' in inventory | ||
435 | group.SetFromAssetID(newAssetID); | ||
436 | } | ||
437 | group.AttachToAgent(remoteClient.AgentId, AttachmentPt, attachPos); | ||
438 | } | ||
439 | else | ||
440 | { | ||
441 | remoteClient.SendAgentAlertMessage("You don't have sufficient permissions to attach this object", false); | ||
434 | } | 442 | } |
435 | group.AttachToAgent(remoteClient.AgentId, AttachmentPt, attachPos); | ||
436 | 443 | ||
437 | } | 444 | } |
438 | 445 | ||