file-format: check gameLevel against range when reading from xml
This commit is contained in:
parent
f17021066a
commit
78bddb83fe
1 changed files with 3 additions and 0 deletions
|
@ -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"));
|
||||
|
|
Reference in a new issue