From 84c2a72140822fc28da3590b48db392d132ef0ea Mon Sep 17 00:00:00 2001 From: MW Date: Sun, 25 Mar 2007 20:23:06 +0000 Subject: Hopefully fixed the texture uploading and the crashing when a prim with a uploaded texture on it is moved. --- OpenSim.RegionServer/Assets/AssetCache.cs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'OpenSim.RegionServer/Assets/AssetCache.cs') diff --git a/OpenSim.RegionServer/Assets/AssetCache.cs b/OpenSim.RegionServer/Assets/AssetCache.cs index c1b3472..3c28e1c 100644 --- a/OpenSim.RegionServer/Assets/AssetCache.cs +++ b/OpenSim.RegionServer/Assets/AssetCache.cs @@ -139,17 +139,23 @@ namespace OpenSim.Assets public void AddAsset(AssetBase asset) { - this._assetServer.UploadNewAsset(asset); if (asset.Type == 0) { - //texture - TextureImage textur = new TextureImage(asset); - this.Textures.Add(textur.FullID, textur); + if (!this.Textures.ContainsKey(asset.FullID)) + { //texture + TextureImage textur = new TextureImage(asset); + this.Textures.Add(textur.FullID, textur); + this._assetServer.UploadNewAsset(asset); + } } else { - AssetInfo assetInf = new AssetInfo(asset); - this.Assets.Add(assetInf.FullID, assetInf); + if (!this.Assets.ContainsKey(asset.FullID)) + { + AssetInfo assetInf = new AssetInfo(asset); + this.Assets.Add(assetInf.FullID, assetInf); + this._assetServer.UploadNewAsset(asset); + } } } -- cgit v1.1