file-format: check gameLevel against range when reading from xml

This commit is contained in:
Jason Long 2013-07-28 07:41:09 -04:00
parent f17021066a
commit 78bddb83fe

View file

@ -1961,6 +1961,9 @@ public class Micropolis
crimeAverage = Integer.parseInt(in.getAttributeValue(null, "crimeAverage"));
pollutionAverage = Integer.parseInt(in.getAttributeValue(null, "pollutionAverage"));
gameLevel = Integer.parseInt(in.getAttributeValue(null, "gameLevel"));
if (!GameLevel.isValid(gameLevel)) {
gameLevel = 0;
}
autoBulldoze = Boolean.parseBoolean(in.getAttributeValue(null, "autoBulldoze"));
autoBudget = Boolean.parseBoolean(in.getAttributeValue(null, "autoBudget"));
autoGo = Boolean.parseBoolean(in.getAttributeValue(null, "autoGo"));