From 53e0cd55342295f8c4639e07420378c2b4a5c3cf Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 15 Nov 2015 10:04:35 +0000 Subject: handle diferente number of wearables on getting assets form another appearance --- OpenSim/Framework/AvatarAppearance.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs index cabba8b..07c739d 100644 --- a/OpenSim/Framework/AvatarAppearance.cs +++ b/OpenSim/Framework/AvatarAppearance.cs @@ -251,9 +251,17 @@ namespace OpenSim.Framework public void GetAssetsFrom(AvatarAppearance app) { - for (int i = 0; i < m_wearables.Length; i++) + int len = m_wearables.Length; + if(len > app.m_wearables.Length) + len = app.m_wearables.Length; + + for (int i = 0; i < len; i++) { - for (int j = 0; j < m_wearables[i].Count; j++) + int count = m_wearables[i].Count; + if(count > app.m_wearables[i].Count) + count = app.m_wearables[i].Count; + + for (int j = 0; j < count; j++) { UUID itemID = m_wearables[i][j].ItemID; UUID assetID = app.Wearables[i].GetAsset(itemID); -- cgit v1.1