file-format: keep misc sanity checks in place
This commit is contained in:
parent
95155a579f
commit
98a2b4b007
1 changed files with 4 additions and 3 deletions
|
@ -1973,9 +1973,6 @@ 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"));
|
||||
|
@ -1983,6 +1980,10 @@ public class Micropolis
|
|||
simSpeed = Speed.valueOf(in.getAttributeValue(null, "simSpeed"));
|
||||
XML_Helper.skipToEndElement(in);
|
||||
|
||||
if (cityTime < 0) { cityTime = 0; }
|
||||
if (cityTax < 0 || cityTax > 20) { cityTax = 7; }
|
||||
if (gameLevel < 0 || gameLevel > 2) { gameLevel = 0; }
|
||||
|
||||
resCap = false;
|
||||
comCap = false;
|
||||
indCap = false;
|
||||
|
|
Reference in a new issue