diff --git a/LegendsViewer/Legends/World.cs b/LegendsViewer/Legends/World.cs index f7a374e..6025b8b 100644 --- a/LegendsViewer/Legends/World.cs +++ b/LegendsViewer/Legends/World.cs @@ -107,7 +107,9 @@ private void GenerateCivIdenticons() //19+ reduced color variance int maxHue = 300; int colorVariance; - if (races.Count <= 6) colorVariance = Convert.ToInt32(Math.Floor(maxHue / Convert.ToDouble(races.Count - 1))); + if (races.Count <= 1) + colorVariance = 0; + else if (races.Count <= 6) colorVariance = Convert.ToInt32(Math.Floor(maxHue / Convert.ToDouble(races.Count - 1))); else if (races.Count > 18) colorVariance = Convert.ToInt32(Math.Floor(maxHue / (Math.Ceiling(races.Count / 3.0) - 1))); else colorVariance = 60; diff --git a/LegendsViewer/Legends/XMLParser.cs b/LegendsViewer/Legends/XMLParser.cs index 0436731..f02ae1f 100644 --- a/LegendsViewer/Legends/XMLParser.cs +++ b/LegendsViewer/Legends/XMLParser.cs @@ -22,7 +22,8 @@ class XMLParser public XMLParser(World world, string xmlFile) { World = world; - XML = new XmlTextReader(xmlFile); + StreamReader reader = new StreamReader(xmlFile, Encoding.GetEncoding("windows-1252")); + XML = new XmlTextReader(reader); XML.WhitespaceHandling = WhitespaceHandling.Significant; }