Change semantics of FromXML on vehicle data to make the serializer a bit cleaner

avinationmerge
Melanie 2012-07-07 19:59:55 +02:00
parent 6d5693a866
commit 470019b52a
2 changed files with 19 additions and 7 deletions

View File

@ -599,7 +599,20 @@ namespace OpenSim.Region.Framework.Scenes
return v;
}
public void FromXml2(XmlTextReader _reader, out bool errors)
public static SOPVehicle FromXml2(XmlTextReader reader)
{
SOPVehicle vehicle = new SOPVehicle();
bool errors = false;
vehicle.FromXml2(reader, out errors);
if (errors)
return null;
return vehicle;
}
private void FromXml2(XmlTextReader _reader, out bool errors)
{
errors = false;
reader = _reader;

View File

@ -623,12 +623,9 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
private static void ProcessVehicle(SceneObjectPart obj, XmlTextReader reader)
{
bool errors = false;
SOPVehicle _vehicle = new SOPVehicle();
SOPVehicle vehicle = SOPVehicle.FromXml2(reader);
_vehicle.FromXml2(reader, out errors);
if (errors)
if (vehicle == null)
{
obj.VehicleParams = null;
m_log.DebugFormat(
@ -636,7 +633,9 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
obj.Name, obj.UUID);
}
else
obj.VehicleParams = _vehicle;
{
obj.VehicleParams = vehicle;
}
}
private static void ProcessShape(SceneObjectPart obj, XmlTextReader reader)