mirror of
git://opensimulator.org/git/opensim
synced 2026-08-14 09:02:50 +00:00
clamp maximum wearables types to Max suported by region (physics type still not supported)
This commit is contained in:
@@ -208,7 +208,10 @@ namespace OpenSim.Framework
|
||||
|
||||
if (copyWearables && (appearance.Wearables != null))
|
||||
{
|
||||
for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++)
|
||||
int len = appearance.Wearables.Length;
|
||||
if(len > AvatarWearable.MAX_WEARABLES)
|
||||
len = AvatarWearable.MAX_WEARABLES;
|
||||
for (int i = 0; i < len; i++)
|
||||
SetWearable(i,appearance.Wearables[i]);
|
||||
}
|
||||
|
||||
@@ -760,7 +763,12 @@ namespace OpenSim.Framework
|
||||
if ((data != null) && (data["wearables"] != null) && (data["wearables"]).Type == OSDType.Array)
|
||||
{
|
||||
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]);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -665,7 +665,12 @@ namespace OpenSim.Framework
|
||||
if ((args["wearables"] != null) && (args["wearables"]).Type == OSDType.Array)
|
||||
{
|
||||
OSDArray wears = (OSDArray)(args["wearables"]);
|
||||
for (int i = 0; i < wears.Count / 2; i++)
|
||||
|
||||
int count = wears.Count;
|
||||
if (count > AvatarWearable.MAX_WEARABLES)
|
||||
count = AvatarWearable.MAX_WEARABLES;
|
||||
|
||||
for (int i = 0; i < count / 2; i++)
|
||||
{
|
||||
AvatarWearable awear = new AvatarWearable((OSDArray)wears[i]);
|
||||
Appearance.SetWearable(i,awear);
|
||||
|
||||
Reference in New Issue
Block a user