Fix handling of non-standard town_block_size values

This commit is contained in:
Mike Primm 2011-08-28 10:12:04 -05:00
parent ac650656b4
commit b20b9e1436

View File

@ -32,7 +32,12 @@ public class TownyConfigHandler {
}
Configuration tcfg = new Configuration(cfgfile);
tcfg.load();
townblocksize = tcfg.getInt("town_block_size", 16); /* Get block size */
String tbsize = tcfg.getNode("town").getString("town_block_size", "16");
try {
townblocksize = Integer.valueOf(tbsize);
} catch (NumberFormatException nfx) {
townblocksize = 16;
}
}
/**
* Get map of attributes for given world