aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-09-06 00:29:37 +0100
committerJustin Clark-Casey (justincc)2011-09-06 00:29:37 +0100
commit0cb0140a1d652c3ba47f1c9000d1ba81c8e786f8 (patch)
tree92b14b8fc3549efe9c84cb2aedb1697bb8fa026e
parentTry disabling the inconsistent attachment state check to see if this actually... (diff)
downloadopensim-SC-0cb0140a1d652c3ba47f1c9000d1ba81c8e786f8.zip
opensim-SC-0cb0140a1d652c3ba47f1c9000d1ba81c8e786f8.tar.gz
opensim-SC-0cb0140a1d652c3ba47f1c9000d1ba81c8e786f8.tar.bz2
opensim-SC-0cb0140a1d652c3ba47f1c9000d1ba81c8e786f8.tar.xz
Stop the pointless double setting of every attachment in AvatarAppearance.
The second was already being filtered out so this has no user level effect
-rw-r--r--OpenSim/Framework/AvatarAppearance.cs14
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs8
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs1
3 files changed, 13 insertions, 10 deletions
diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs
index aed9087..0b0afeb 100644
--- a/OpenSim/Framework/AvatarAppearance.cs
+++ b/OpenSim/Framework/AvatarAppearance.cs
@@ -402,8 +402,13 @@ namespace OpenSim.Framework
402 402
403 internal void AppendAttachment(AvatarAttachment attach) 403 internal void AppendAttachment(AvatarAttachment attach)
404 { 404 {
405 if (! m_attachments.ContainsKey(attach.AttachPoint)) 405// m_log.DebugFormat(
406// "[AVATAR APPEARNCE]: Appending itemID={0}, assetID={1} at {2}",
407// attach.ItemID, attach.AssetID, attach.AttachPoint);
408
409 if (!m_attachments.ContainsKey(attach.AttachPoint))
406 m_attachments[attach.AttachPoint] = new List<AvatarAttachment>(); 410 m_attachments[attach.AttachPoint] = new List<AvatarAttachment>();
411
407 m_attachments[attach.AttachPoint].Add(attach); 412 m_attachments[attach.AttachPoint].Add(attach);
408 } 413 }
409 414
@@ -430,13 +435,13 @@ namespace OpenSim.Framework
430 /// </returns> 435 /// </returns>
431 public bool SetAttachment(int attachpoint, UUID item, UUID asset) 436 public bool SetAttachment(int attachpoint, UUID item, UUID asset)
432 { 437 {
433 if (attachpoint == 0)
434 return false;
435
436// m_log.DebugFormat( 438// m_log.DebugFormat(
437// "[AVATAR APPEARANCE]: Setting attachment at {0} with item ID {1}, asset ID {2}", 439// "[AVATAR APPEARANCE]: Setting attachment at {0} with item ID {1}, asset ID {2}",
438// attachpoint, item, asset); 440// attachpoint, item, asset);
439 441
442 if (attachpoint == 0)
443 return false;
444
440 if (item == UUID.Zero) 445 if (item == UUID.Zero)
441 { 446 {
442 if (m_attachments.ContainsKey(attachpoint)) 447 if (m_attachments.ContainsKey(attachpoint))
@@ -465,6 +470,7 @@ namespace OpenSim.Framework
465 { 470 {
466 ReplaceAttachment(new AvatarAttachment(attachpoint,item, asset)); 471 ReplaceAttachment(new AvatarAttachment(attachpoint,item, asset));
467 } 472 }
473
468 return true; 474 return true;
469 } 475 }
470 476
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index 4881499..e2e697e 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -242,7 +242,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
242 { 242 {
243// m_log.DebugFormat( 243// m_log.DebugFormat(
244// "[ATTACHMENTS MODULE]: Attaching object {0} {1} to {2} point {3} from ground (silent = {4})", 244// "[ATTACHMENTS MODULE]: Attaching object {0} {1} to {2} point {3} from ground (silent = {4})",
245// group.Name, group.LocalId, sp.Name, AttachmentPt, silent); 245// group.Name, group.LocalId, sp.Name, attachmentPt, silent);
246 246
247 if (sp.GetAttachments(attachmentPt).Contains(group)) 247 if (sp.GetAttachments(attachmentPt).Contains(group))
248 { 248 {
@@ -356,8 +356,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
356 { 356 {
357 if (att == null) 357 if (att == null)
358 DetachSingleAttachmentToInv(itemID, sp.ControllingClient); 358 DetachSingleAttachmentToInv(itemID, sp.ControllingClient);
359 else
360 ShowAttachInUserInventory(att, sp, itemID, AttachmentPt);
361 } 359 }
362 360
363 return att; 361 return att;
@@ -386,9 +384,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
386 384
387 if (objatt != null) 385 if (objatt != null)
388 { 386 {
389 // Loading the inventory from XML will have set this, but 387 // HasGroupChanged is being set from within RezObject. Ideally it would be set by the caller.
390 // there is no way the object could have changed yet,
391 // since scripts aren't running yet. So, clear it here.
392 objatt.HasGroupChanged = false; 388 objatt.HasGroupChanged = false;
393 bool tainted = false; 389 bool tainted = false;
394 if (attachmentPt != 0 && attachmentPt != objatt.AttachmentPoint) 390 if (attachmentPt != 0 && attachmentPt != objatt.AttachmentPoint)
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs
index 363e258..3f8c01f 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs
@@ -150,6 +150,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
150 Assert.That(attSo.IsTemporary, Is.False); 150 Assert.That(attSo.IsTemporary, Is.False);
151 151
152 // Check appearance status 152 // Check appearance status
153 Assert.That(m_presence.Appearance.GetAttachments().Count, Is.EqualTo(1));
153 Assert.That(m_presence.Appearance.GetAttachpoint(attItemId), Is.EqualTo((int)AttachmentPoint.Chest)); 154 Assert.That(m_presence.Appearance.GetAttachpoint(attItemId), Is.EqualTo((int)AttachmentPoint.Chest));
154 } 155 }
155 156