fix problem persisting when only one face had a media texture

prebuild-update
Justin Clark-Casey (justincc) 2010-07-12 21:33:27 +01:00
parent c76e2ce250
commit 43f480864b
2 changed files with 15 additions and 2 deletions

View File

@ -1867,7 +1867,10 @@ namespace OpenSim.Data.SQLite
List<MediaEntry> mediaEntries = new List<MediaEntry>();
foreach (OSD osdMe in osdMeArray)
mediaEntries.Add(MediaEntry.FromOSD(osdMe));
{
MediaEntry me = (osdMe is OSDMap ? MediaEntry.FromOSD(osdMe) : new MediaEntry());
mediaEntries.Add(me);
}
s.Media = mediaEntries;
}
@ -1918,7 +1921,10 @@ namespace OpenSim.Data.SQLite
OSDArray meArray = new OSDArray();
foreach (MediaEntry me in s.Media)
meArray.Add(me.GetOSD());
{
OSD osd = (null == me ? new OSD() : me.GetOSD());
meArray.Add(osd);
}
row["Media"] = OSDParser.SerializeLLSDXmlString(meArray);
}

View File

@ -212,6 +212,13 @@ namespace OpenSim.Region.CoreModules.Media.Moap
}
m_log.DebugFormat("[MOAP]: Received {0} media entries for prim {1}", omu.FaceMedia.Length, primId);
// for (int i = 0; i < omu.FaceMedia.Length; i++)
// {
// MediaEntry me = omu.FaceMedia[i];
// string v = (null == me ? "null": OSDParser.SerializeLLSDXmlString(me.GetOSD()));
// m_log.DebugFormat("[MOAP]: Face {0} [{1}]", i, v);
// }
part.Shape.Media = new List<MediaEntry>(omu.FaceMedia);