From bc0ff5e7d43b873f8895f782c73170a84b5c35d6 Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Thu, 2 May 2013 15:23:37 +0300 Subject: Allow Boolean nodes in XML to be specified as "0/1". AuroraSim does that. --- OpenSim/Framework/Util.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index e8dfec1..52635b2 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -2029,8 +2029,10 @@ namespace OpenSim.Framework #region Xml Serialization Utilities public static bool ReadBoolean(XmlTextReader reader) { + // AuroraSim uses "int" for some fields that are boolean in OpenSim, e.g. "PassCollisions". Don't fail because of this. reader.ReadStartElement(); - bool result = Boolean.Parse(reader.ReadContentAsString().ToLower()); + string val = reader.ReadContentAsString().ToLower(); + bool result = val.Equals("true") || val.Equals("1"); reader.ReadEndElement(); return result; -- cgit v1.1