diff options
author | teravus | 2013-03-08 19:32:47 -0500 |
---|---|---|
committer | teravus | 2013-03-08 19:32:47 -0500 |
commit | 5097437e1174d19d3dcb68e936581e60e4ef49cc (patch) | |
tree | 4b932055ce886d9ada47f9c164221ac32192ffc9 | |
parent | * Just another one of those new packet blocks causing a null ref. Defaultin... (diff) | |
download | opensim-SC_OLD-5097437e1174d19d3dcb68e936581e60e4ef49cc.zip opensim-SC_OLD-5097437e1174d19d3dcb68e936581e60e4ef49cc.tar.gz opensim-SC_OLD-5097437e1174d19d3dcb68e936581e60e4ef49cc.tar.bz2 opensim-SC_OLD-5097437e1174d19d3dcb68e936581e60e4ef49cc.tar.xz |
* 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.
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 17 |
1 files changed, 17 insertions, 0 deletions
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 | |||
4503 | 4503 | ||
4504 | Changed changeFlags = 0; | 4504 | Changed changeFlags = 0; |
4505 | 4505 | ||
4506 | Primitive.TextureEntryFace fallbackNewFace = newTex.DefaultTexture; | ||
4507 | Primitive.TextureEntryFace fallbackOldFace = oldTex.DefaultTexture; | ||
4508 | |||
4509 | // On Incoming packets, sometimes newText.DefaultTexture is null. The assumption is that all | ||
4510 | // other prim-sides are set, but apparently that's not always the case. Lets assume packet/data corruption at this point. | ||
4511 | if (fallbackNewFace == null) | ||
4512 | { | ||
4513 | fallbackNewFace = new Primitive.TextureEntry(Util.BLANK_TEXTURE_UUID).CreateFace(0); | ||
4514 | newTex.DefaultTexture = fallbackNewFace; | ||
4515 | } | ||
4516 | if (fallbackOldFace == null) | ||
4517 | { | ||
4518 | fallbackOldFace = new Primitive.TextureEntry(Util.BLANK_TEXTURE_UUID).CreateFace(0); | ||
4519 | oldTex.DefaultTexture = fallbackOldFace; | ||
4520 | } | ||
4521 | |||
4506 | for (int i = 0 ; i < GetNumberOfSides(); i++) | 4522 | for (int i = 0 ; i < GetNumberOfSides(); i++) |
4507 | { | 4523 | { |
4524 | |||
4508 | Primitive.TextureEntryFace newFace = newTex.DefaultTexture; | 4525 | Primitive.TextureEntryFace newFace = newTex.DefaultTexture; |
4509 | Primitive.TextureEntryFace oldFace = oldTex.DefaultTexture; | 4526 | Primitive.TextureEntryFace oldFace = oldTex.DefaultTexture; |
4510 | 4527 | ||