fix the protection for more Wearables than region suports

avinationmerge
UbitUmarov 2015-11-15 08:16:52 +00:00
parent 554d4bad8d
commit bcb27d4406
1 changed files with 9 additions and 6 deletions

View File

@ -458,11 +458,11 @@ namespace OpenSim.Framework
// m_log.WarnFormat("[AVATARAPPEARANCE] set wearable {0} --> {1}:{2}",wearableId,wearable.ItemID,wearable.AssetID); // m_log.WarnFormat("[AVATARAPPEARANCE] set wearable {0} --> {1}:{2}",wearableId,wearable.ItemID,wearable.AssetID);
// DEBUG OFF // DEBUG OFF
m_wearables[wearableId].Clear(); m_wearables[wearableId].Clear();
int count = wearable.Count; int count = wearable.Count;
if (count > AvatarWearable.MAX_WEARABLES) if (count > AvatarWearable.MAX_WEARABLES)
count = AvatarWearable.MAX_WEARABLES; count = AvatarWearable.MAX_WEARABLES;
for (int i = 0; i < count; i++) for (int i = 0; i < count; i++)
m_wearables[wearableId].Add(wearable[i].ItemID, wearable[i].AssetID); m_wearables[wearableId].Add(wearable[i].ItemID, wearable[i].AssetID);
} }
// DEBUG ON // DEBUG ON
@ -760,7 +760,10 @@ namespace OpenSim.Framework
if ((data != null) && (data["wearables"] != null) && (data["wearables"]).Type == OSDType.Array) if ((data != null) && (data["wearables"] != null) && (data["wearables"]).Type == OSDType.Array)
{ {
OSDArray wears = (OSDArray)(data["wearables"]); OSDArray wears = (OSDArray)(data["wearables"]);
for (int i = 0; i < wears.Count; i++) int count = wears.Count;
if (count > AvatarWearable.MAX_WEARABLES)
count = AvatarWearable.MAX_WEARABLES;
for (int i = 0; i < count; i++)
m_wearables[i] = new AvatarWearable((OSDArray)wears[i]); m_wearables[i] = new AvatarWearable((OSDArray)wears[i]);
} }
else else