aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs')
-rw-r--r--OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs15
1 files changed, 7 insertions, 8 deletions
diff --git a/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs b/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs
index 4a92120..331f1bd 100644
--- a/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs
+++ b/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs
@@ -267,24 +267,24 @@ namespace OpenSim.Region.OptionalModules.Materials
267 if (matsArr == null) 267 if (matsArr == null)
268 return partchanged; 268 return partchanged;
269 269
270 OSD tmpOSD;
271 foreach (OSD elemOsd in matsArr) 270 foreach (OSD elemOsd in matsArr)
272 { 271 {
273 if (elemOsd != null && elemOsd is OSDMap) 272 if (elemOsd != null && elemOsd is OSDMap)
274 { 273 {
275 OSDMap matMap = elemOsd as OSDMap; 274 OSDMap matMap = elemOsd as OSDMap;
276 if (matMap.ContainsKey("ID") && matMap.ContainsKey("Material")) 275 OSD OSDID;
276 OSD OSDMaterial;
277 if (matMap.TryGetValue("ID", out OSDID) && matMap.TryGetValue("Material", out OSDMaterial) && OSDMaterial is OSDMap)
277 { 278 {
278 try 279 try
279 { 280 {
280 lock (materialslock) 281 lock (materialslock)
281 { 282 {
282 tmpOSD = matMap["ID"]; 283 UUID id = OSDID.AsUUID();
283 UUID id = tmpOSD.AsUUID();
284 if(m_Materials.ContainsKey(id)) 284 if(m_Materials.ContainsKey(id))
285 continue; 285 continue;
286 286
287 OSDMap theMatMap = (OSDMap)matMap["Material"]; 287 OSDMap theMatMap = (OSDMap)OSDMaterial;
288 FaceMaterial fmat = new FaceMaterial(theMatMap); 288 FaceMaterial fmat = new FaceMaterial(theMatMap);
289 289
290 if(fmat == null || 290 if(fmat == null ||
@@ -292,7 +292,7 @@ namespace OpenSim.Region.OptionalModules.Materials
292 && fmat.NormalMapID == UUID.Zero 292 && fmat.NormalMapID == UUID.Zero
293 && fmat.SpecularMapID == UUID.Zero)) 293 && fmat.SpecularMapID == UUID.Zero))
294 continue; 294 continue;
295 295
296 fmat.ID = id; 296 fmat.ID = id;
297 m_Materials[id] = fmat; 297 m_Materials[id] = fmat;
298 m_MaterialsRefCount[id] = 0; 298 m_MaterialsRefCount[id] = 0;
@@ -560,8 +560,7 @@ namespace OpenSim.Region.OptionalModules.Materials
560 uint primLocalID = 0; 560 uint primLocalID = 0;
561 try 561 try
562 { 562 {
563 tmpOSD = matsMap["ID"]; 563 primLocalID = matsMap["ID"].AsUInteger();
564 primLocalID = tmpOSD.AsUInteger();
565 } 564 }
566 catch (Exception e) 565 catch (Exception e)
567 { 566 {