From 5097437e1174d19d3dcb68e936581e60e4ef49cc Mon Sep 17 00:00:00 2001 From: teravus Date: Fri, 8 Mar 2013 19:32:47 -0500 Subject: * Apparently, sometimes texture entries come in from the wire with no default texture defined.. so apply better fallback protection against that. The net result is clients will have their selected textures set when they would have previously had an ignored exception. --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index cce8b21..3e9a6fa 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -4503,8 +4503,25 @@ namespace OpenSim.Region.Framework.Scenes Changed changeFlags = 0; + Primitive.TextureEntryFace fallbackNewFace = newTex.DefaultTexture; + Primitive.TextureEntryFace fallbackOldFace = oldTex.DefaultTexture; + + // On Incoming packets, sometimes newText.DefaultTexture is null. The assumption is that all + // other prim-sides are set, but apparently that's not always the case. Lets assume packet/data corruption at this point. + if (fallbackNewFace == null) + { + fallbackNewFace = new Primitive.TextureEntry(Util.BLANK_TEXTURE_UUID).CreateFace(0); + newTex.DefaultTexture = fallbackNewFace; + } + if (fallbackOldFace == null) + { + fallbackOldFace = new Primitive.TextureEntry(Util.BLANK_TEXTURE_UUID).CreateFace(0); + oldTex.DefaultTexture = fallbackOldFace; + } + for (int i = 0 ; i < GetNumberOfSides(); i++) { + Primitive.TextureEntryFace newFace = newTex.DefaultTexture; Primitive.TextureEntryFace oldFace = oldTex.DefaultTexture; -- cgit v1.1