]> git.pond.sub.org Git - empserver/commitdiff
emp_config: Don't monkey-patch WORLD_X to be even
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 22 Feb 2015 07:04:41 +0000 (08:04 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Mon, 2 Mar 2015 07:20:52 +0000 (08:20 +0100)
emp_config() silently truncates WORLD_X to even.  Drop that.  We could
flag odd WORLD_X as error, but we don't validate the other
configuration values, so why this one?  Instead document it needs to
be even.  WORLD_Y, too.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
include/econfig-spec.h
src/lib/common/emp_config.c

index dcde56e2d51e6c40f49fe787f866a86ab60e41d9..6d49838677978517801f8fbbd50d2d1ebdfd6a42 100644 (file)
@@ -28,7 +28,7 @@
  *
  *  Known contributors to this file:
  *     Marc Olzheim, 2004
  *
  *  Known contributors to this file:
  *     Marc Olzheim, 2004
- *     Markus Armbruster, 2004-2014
+ *     Markus Armbruster, 2004-2015
  */
 
 /*
  */
 
 /*
@@ -108,9 +108,9 @@ EMPCFBOTH("privlog", privlog, char *, NSC_STRING, 0,
 EMPCFBOTH("privip", privip, char *, NSC_STRING, KM_INTERNAL,
     "Deities may connect from these IPs or networks, \"\" allows all")
 EMPCFBOTH("WORLD_X", WORLD_X, int, NSC_INT, 0,
 EMPCFBOTH("privip", privip, char *, NSC_STRING, KM_INTERNAL,
     "Deities may connect from these IPs or networks, \"\" allows all")
 EMPCFBOTH("WORLD_X", WORLD_X, int, NSC_INT, 0,
-    "World size X dimension (enforced to be even by subtracting 1 if necessary)")
+    "World size X dimension, must be even")
 EMPCFBOTH("WORLD_Y", WORLD_Y, int, NSC_INT, 0,
 EMPCFBOTH("WORLD_Y", WORLD_Y, int, NSC_INT, 0,
-    "World size Y dimension")
+    "World size Y dimension, must be even")
 
 EMPCF_COMMENT("\n\n### Update policy\n\n"
     "# Note: the update schedule is defined in the file schedule in the\n"
 
 EMPCF_COMMENT("\n\n### Update policy\n\n"
     "# Note: the update schedule is defined in the file schedule in the\n"
index 70b8176cfcfb5d5c05b4355bd5e1d2e78ee4956e..ff698ff6a16544583a533f32da49a103b1f0f7aa 100644 (file)
@@ -138,7 +138,6 @@ emp_config(char *file)
     fclose(fp);
 
 done:
     fclose(fp);
 
 done:
-    WORLD_X &= ~1;             /* force even */
     if (set_paths(file) < 0)
        return -1;
 
     if (set_paths(file) < 0)
        return -1;