From 3312938f6b94a549dead9ceeefaa059c631ec725 Mon Sep 17 00:00:00 2001 From: Dr Scofield Date: Thu, 7 May 2009 11:58:45 +0000 Subject: From: Alan Webb logs error message on empty data in DynamicTextureModule --- .../Scripting/DynamicTexture/DynamicTextureModule.cs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs index d7b4d17..a2d6b45 100644 --- a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs @@ -246,10 +246,21 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture /// public void DataReceived(byte[] data, Scene scene) { + SceneObjectPart part = scene.GetSceneObjectPart(PrimID); + + if (data == null) + { + string msg = + String.Format("DynamicTextureModule: Error preparing image using URL {0}", Url); + scene.SimChat(Utils.StringToBytes(msg), ChatTypeEnum.Say, + 0, part.ParentGroup.RootPart.AbsolutePosition, part.Name, part.UUID, false); + return; + } + byte[] assetData; AssetBase oldAsset = null; - + if (BlendWithOldTexture) { UUID lastTextureID = part.Shape.Textures.DefaultTexture.TextureID; @@ -295,11 +306,11 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture // remove the old asset from the cache UUID oldID = tmptex.DefaultTexture.TextureID; - + tmptex.DefaultTexture.TextureID = asset.FullID; // I'm pretty sure we always want to force this to true - // I'm pretty sure noone whats to set fullbright true if it wasn't true before. -// tmptex.DefaultTexture.Fullbright = true; + // I'm pretty sure noone whats to set fullbright true if it wasn't true before. + // tmptex.DefaultTexture.Fullbright = true; part.Shape.Textures = tmptex; part.ScheduleFullUpdate(); -- cgit v1.1