Change semantics of FromXML on vehicle data to make the serializer a bit cleaner
parent
6d5693a866
commit
470019b52a
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue