diff options
author | diva | 2009-03-27 20:18:55 +0000 |
---|---|---|
committer | diva | 2009-03-27 20:18:55 +0000 |
commit | bce5ed5812cc4385852a324da8a478086a7a0d37 (patch) | |
tree | 4f7d83e404137e236bd61b021f392eeb34632f3b /OpenSim/Region/Framework/Scenes | |
parent | * minor: remove one mono compiler warning (diff) | |
download | opensim-SC-bce5ed5812cc4385852a324da8a478086a7a0d37.zip opensim-SC-bce5ed5812cc4385852a324da8a478086a7a0d37.tar.gz opensim-SC-bce5ed5812cc4385852a324da8a478086a7a0d37.tar.bz2 opensim-SC-bce5ed5812cc4385852a324da8a478086a7a0d37.tar.xz |
Moved a method GetDefaultVisualParameters from Scene to AvatarAppearance, where it belongs. Better error handling in ScenePresence.CopyFrom.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 13 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 7 |
2 files changed, 6 insertions, 14 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index a60f7d8..1891f9d 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -3361,21 +3361,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
3361 | 3361 | ||
3362 | public static void GetDefaultAvatarAppearance(out AvatarWearable[] wearables, out byte[] visualParams) | 3362 | public static void GetDefaultAvatarAppearance(out AvatarWearable[] wearables, out byte[] visualParams) |
3363 | { | 3363 | { |
3364 | visualParams = GetDefaultVisualParams(); | 3364 | visualParams = AvatarAppearance.GetDefaultVisualParams(); |
3365 | wearables = AvatarWearable.DefaultWearables; | 3365 | wearables = AvatarWearable.DefaultWearables; |
3366 | } | 3366 | } |
3367 | 3367 | ||
3368 | private static byte[] GetDefaultVisualParams() | ||
3369 | { | ||
3370 | byte[] visualParams; | ||
3371 | visualParams = new byte[218]; | ||
3372 | for (int i = 0; i < 218; i++) | ||
3373 | { | ||
3374 | visualParams[i] = 100; | ||
3375 | } | ||
3376 | return visualParams; | ||
3377 | } | ||
3378 | |||
3379 | #endregion | 3368 | #endregion |
3380 | 3369 | ||
3381 | public void RegionHandleRequest(IClientAPI client, UUID regionID) | 3370 | public void RegionHandleRequest(IClientAPI client, UUID regionID) |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index a6d1ad3..c78aceb 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -2849,6 +2849,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2849 | uint i = 0; | 2849 | uint i = 0; |
2850 | try | 2850 | try |
2851 | { | 2851 | { |
2852 | if (cAgent.Wearables == null) | ||
2853 | cAgent.Wearables = new UUID[0]; | ||
2852 | AvatarWearable[] wears = new AvatarWearable[cAgent.Wearables.Length / 2]; | 2854 | AvatarWearable[] wears = new AvatarWearable[cAgent.Wearables.Length / 2]; |
2853 | for (uint n = 0; n < cAgent.Wearables.Length; n += 2) | 2855 | for (uint n = 0; n < cAgent.Wearables.Length; n += 2) |
2854 | { | 2856 | { |
@@ -2857,12 +2859,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
2857 | wears[i++] = new AvatarWearable(itemId, assetId); | 2859 | wears[i++] = new AvatarWearable(itemId, assetId); |
2858 | } | 2860 | } |
2859 | m_appearance.Wearables = wears; | 2861 | m_appearance.Wearables = wears; |
2860 | |||
2861 | byte[] te = null; | 2862 | byte[] te = null; |
2862 | if (cAgent.AgentTextures != null) | 2863 | if (cAgent.AgentTextures != null) |
2863 | te = cAgent.AgentTextures; | 2864 | te = cAgent.AgentTextures; |
2864 | else | 2865 | else |
2865 | te = AvatarAppearance.GetDefaultTexture().ToBytes(); | 2866 | te = AvatarAppearance.GetDefaultTexture().ToBytes(); |
2867 | if ((cAgent.VisualParams == null) || (cAgent.VisualParams.Length < AvatarAppearance.VISUALPARAM_COUNT)) | ||
2868 | cAgent.VisualParams = AvatarAppearance.GetDefaultVisualParams(); | ||
2866 | m_appearance.SetAppearance(te, new List<byte>(cAgent.VisualParams)); | 2869 | m_appearance.SetAppearance(te, new List<byte>(cAgent.VisualParams)); |
2867 | } | 2870 | } |
2868 | catch (Exception e) | 2871 | catch (Exception e) |