diff options
author | UbitUmarov | 2015-11-15 08:16:52 +0000 |
---|---|---|
committer | UbitUmarov | 2015-11-15 08:16:52 +0000 |
commit | bcb27d44062c478508f1cd5d211d204b2f151e8a (patch) | |
tree | e64eb256a089c05768d3f832566e44fd99dbb86a | |
parent | Fixed typos (diff) | |
download | opensim-SC_OLD-bcb27d44062c478508f1cd5d211d204b2f151e8a.zip opensim-SC_OLD-bcb27d44062c478508f1cd5d211d204b2f151e8a.tar.gz opensim-SC_OLD-bcb27d44062c478508f1cd5d211d204b2f151e8a.tar.bz2 opensim-SC_OLD-bcb27d44062c478508f1cd5d211d204b2f151e8a.tar.xz |
fix the protection for more Wearables than region suports
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/AvatarAppearance.cs | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs index f442fc2..e1725a9 100644 --- a/OpenSim/Framework/AvatarAppearance.cs +++ b/OpenSim/Framework/AvatarAppearance.cs | |||
@@ -458,11 +458,11 @@ namespace OpenSim.Framework | |||
458 | // m_log.WarnFormat("[AVATARAPPEARANCE] set wearable {0} --> {1}:{2}",wearableId,wearable.ItemID,wearable.AssetID); | 458 | // m_log.WarnFormat("[AVATARAPPEARANCE] set wearable {0} --> {1}:{2}",wearableId,wearable.ItemID,wearable.AssetID); |
459 | // DEBUG OFF | 459 | // DEBUG OFF |
460 | m_wearables[wearableId].Clear(); | 460 | m_wearables[wearableId].Clear(); |
461 | int count = wearable.Count; | 461 | int count = wearable.Count; |
462 | if (count > AvatarWearable.MAX_WEARABLES) | 462 | if (count > AvatarWearable.MAX_WEARABLES) |
463 | count = AvatarWearable.MAX_WEARABLES; | 463 | count = AvatarWearable.MAX_WEARABLES; |
464 | for (int i = 0; i < count; i++) | 464 | for (int i = 0; i < count; i++) |
465 | m_wearables[wearableId].Add(wearable[i].ItemID, wearable[i].AssetID); | 465 | m_wearables[wearableId].Add(wearable[i].ItemID, wearable[i].AssetID); |
466 | } | 466 | } |
467 | 467 | ||
468 | // DEBUG ON | 468 | // DEBUG ON |
@@ -760,7 +760,10 @@ namespace OpenSim.Framework | |||
760 | if ((data != null) && (data["wearables"] != null) && (data["wearables"]).Type == OSDType.Array) | 760 | if ((data != null) && (data["wearables"] != null) && (data["wearables"]).Type == OSDType.Array) |
761 | { | 761 | { |
762 | OSDArray wears = (OSDArray)(data["wearables"]); | 762 | OSDArray wears = (OSDArray)(data["wearables"]); |
763 | for (int i = 0; i < wears.Count; i++) | 763 | int count = wears.Count; |
764 | if (count > AvatarWearable.MAX_WEARABLES) | ||
765 | count = AvatarWearable.MAX_WEARABLES; | ||
766 | for (int i = 0; i < count; i++) | ||
764 | m_wearables[i] = new AvatarWearable((OSDArray)wears[i]); | 767 | m_wearables[i] = new AvatarWearable((OSDArray)wears[i]); |
765 | } | 768 | } |
766 | else | 769 | else |