diff options
author | UbitUmarov | 2014-08-07 23:29:31 +0100 |
---|---|---|
committer | UbitUmarov | 2014-08-07 23:29:31 +0100 |
commit | 4ae0bb7df1774426ffa77898ac062a24bc6234f5 (patch) | |
tree | 5fa22dbe944bda41a5e88eef2696c106b454472f /OpenSim/Framework/AvatarAppearance.cs | |
parent | update the max number of texture faces and wearables to current values. (diff) | |
download | opensim-SC-4ae0bb7df1774426ffa77898ac062a24bc6234f5.zip opensim-SC-4ae0bb7df1774426ffa77898ac062a24bc6234f5.tar.gz opensim-SC-4ae0bb7df1774426ffa77898ac062a24bc6234f5.tar.bz2 opensim-SC-4ae0bb7df1774426ffa77898ac062a24bc6234f5.tar.xz |
add limites checks on wearables size, revert to max 15 for
compatibility/testing
Diffstat (limited to 'OpenSim/Framework/AvatarAppearance.cs')
-rw-r--r-- | OpenSim/Framework/AvatarAppearance.cs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs index 40179a2..c384336 100644 --- a/OpenSim/Framework/AvatarAppearance.cs +++ b/OpenSim/Framework/AvatarAppearance.cs | |||
@@ -462,7 +462,10 @@ namespace OpenSim.Framework | |||
462 | // m_log.WarnFormat("[AVATARAPPEARANCE] set wearable {0} --> {1}:{2}",wearableId,wearable.ItemID,wearable.AssetID); | 462 | // m_log.WarnFormat("[AVATARAPPEARANCE] set wearable {0} --> {1}:{2}",wearableId,wearable.ItemID,wearable.AssetID); |
463 | // DEBUG OFF | 463 | // DEBUG OFF |
464 | m_wearables[wearableId].Clear(); | 464 | m_wearables[wearableId].Clear(); |
465 | for (int i = 0; i < wearable.Count; i++) | 465 | int count = wearable.Count; |
466 | if (count > AvatarWearable.MAX_WEARABLES) | ||
467 | count = AvatarWearable.MAX_WEARABLES; | ||
468 | for (int i = 0; i < count; i++) | ||
466 | m_wearables[wearableId].Add(wearable[i].ItemID, wearable[i].AssetID); | 469 | m_wearables[wearableId].Add(wearable[i].ItemID, wearable[i].AssetID); |
467 | } | 470 | } |
468 | 471 | ||
@@ -755,7 +758,12 @@ namespace OpenSim.Framework | |||
755 | if ((data != null) && (data["wearables"] != null) && (data["wearables"]).Type == OSDType.Array) | 758 | if ((data != null) && (data["wearables"] != null) && (data["wearables"]).Type == OSDType.Array) |
756 | { | 759 | { |
757 | OSDArray wears = (OSDArray)(data["wearables"]); | 760 | OSDArray wears = (OSDArray)(data["wearables"]); |
758 | for (int i = 0; i < wears.Count; i++) | 761 | |
762 | int count = wears.Count; | ||
763 | if (count > AvatarWearable.MAX_WEARABLES) | ||
764 | count = AvatarWearable.MAX_WEARABLES; | ||
765 | |||
766 | for (int i = 0; i < count; i++) | ||
759 | m_wearables[i] = new AvatarWearable((OSDArray)wears[i]); | 767 | m_wearables[i] = new AvatarWearable((OSDArray)wears[i]); |
760 | } | 768 | } |
761 | else | 769 | else |