main() rejects the distance between continents when it exceeds WORLD_X
/ 2 and WORLD_Y / 2, and the distance between continents and islands
when it exceeds WORLD_Y and WORLD_Y. Nuts. Has always been that way.
Reject either when it exceeds the maximum distance between sectors.
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
static void
parse_args(int argc, char *argv[])
{
+ int dist_max = mapdist(0, 0, WORLD_X / 2, WORLD_Y / 2);
+
if (argc < 2) {
help("missing arguments");
exit(1);
program_name);
exit(1);
}
- if (di > WORLD_X / 2 || di > WORLD_Y / 2) {
+ if (di > dist_max) {
fprintf(stderr, "%s: distance between continents too large\n",
program_name);
exit(1);
program_name);
exit(1);
}
- if (id > WORLD_X || id > WORLD_Y) {
+ if (id > dist_max) {
fprintf(stderr,
"%s: distance from islands to continents too large\n",
program_name);