diff options
Diffstat (limited to 'OpenSim/Framework/AvatarAppearance.cs')
-rw-r--r-- | OpenSim/Framework/AvatarAppearance.cs | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs index a34c85f..c384336 100644 --- a/OpenSim/Framework/AvatarAppearance.cs +++ b/OpenSim/Framework/AvatarAppearance.cs | |||
@@ -53,7 +53,11 @@ namespace OpenSim.Framework | |||
53 | // should be only used as initial default value ( V1 viewers ) | 53 | // should be only used as initial default value ( V1 viewers ) |
54 | public readonly static int VISUALPARAM_COUNT = 218; | 54 | public readonly static int VISUALPARAM_COUNT = 218; |
55 | 55 | ||
56 | public readonly static int TEXTURE_COUNT = 21; | 56 | // public readonly static int TEXTURE_COUNT = 21 |
57 | // 21 bad, make it be updated as libovm gets update | ||
58 | // also keeping in sync with it | ||
59 | public readonly static int TEXTURE_COUNT = Primitive.TextureEntry.MAX_FACES; | ||
60 | |||
57 | public readonly static byte[] BAKE_INDICES = new byte[] { 8, 9, 10, 11, 19, 20 }; | 61 | public readonly static byte[] BAKE_INDICES = new byte[] { 8, 9, 10, 11, 19, 20 }; |
58 | 62 | ||
59 | protected int m_serial = 0; | 63 | protected int m_serial = 0; |
@@ -458,7 +462,10 @@ namespace OpenSim.Framework | |||
458 | // 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); |
459 | // DEBUG OFF | 463 | // DEBUG OFF |
460 | m_wearables[wearableId].Clear(); | 464 | m_wearables[wearableId].Clear(); |
461 | 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++) | ||
462 | m_wearables[wearableId].Add(wearable[i].ItemID, wearable[i].AssetID); | 469 | m_wearables[wearableId].Add(wearable[i].ItemID, wearable[i].AssetID); |
463 | } | 470 | } |
464 | 471 | ||
@@ -751,7 +758,12 @@ namespace OpenSim.Framework | |||
751 | if ((data != null) && (data["wearables"] != null) && (data["wearables"]).Type == OSDType.Array) | 758 | if ((data != null) && (data["wearables"] != null) && (data["wearables"]).Type == OSDType.Array) |
752 | { | 759 | { |
753 | OSDArray wears = (OSDArray)(data["wearables"]); | 760 | OSDArray wears = (OSDArray)(data["wearables"]); |
754 | 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++) | ||
755 | m_wearables[i] = new AvatarWearable((OSDArray)wears[i]); | 767 | m_wearables[i] = new AvatarWearable((OSDArray)wears[i]); |
756 | } | 768 | } |
757 | else | 769 | else |