diff --git a/src/decl.c b/src/decl.c index 758cca74e..43bca2d8e 100644 --- a/src/decl.c +++ b/src/decl.c @@ -24,7 +24,10 @@ NEARDATA int nroom = 0; NEARDATA int nsubroom = 0; NEARDATA int occtime = 0; -int x_maze_max, y_maze_max; /* initialized in main, used in mkmaze.c */ +/* maze limits must be even; masking off lowest bit guarantees that */ +int x_maze_max = (COLNO-1) & ~1, + y_maze_max = (ROWNO-1) & ~1; + int otg_temp; /* used by object_to_glyph() [otg] */ #ifdef REDO diff --git a/sys/be/bemain.c b/sys/be/bemain.c index 3f67fc0c0..001d3ddf8 100644 --- a/sys/be/bemain.c +++ b/sys/be/bemain.c @@ -57,17 +57,6 @@ int MAIN(int argc, char **argv) dlb_init(); /* must be before newgame() */ - /* - * Initialization of the boundaries of the mazes - * Both boundaries have to be even. - */ - x_maze_max = COLNO-1; - if (x_maze_max % 2) - x_maze_max--; - y_maze_max = ROWNO-1; - if (y_maze_max % 2) - y_maze_max--; - /* * Initialize the vision system. This must be before mklev() on a * new game or before a level restore on a saved game. diff --git a/sys/mac/macmain.c b/sys/mac/macmain.c index 0ad68009e..3293f46ed 100644 --- a/sys/mac/macmain.c +++ b/sys/mac/macmain.c @@ -46,18 +46,6 @@ main (void) hname = "Mac Hack"; hackpid = getpid(); - /* - * Initialisation of the boundaries of the mazes - * Both boundaries have to be even. - */ - - x_maze_max = COLNO-1; - if (x_maze_max % 2) - x_maze_max--; - y_maze_max = ROWNO-1; - if (y_maze_max % 2) - y_maze_max--; - setrandom(); initoptions(); init_nhwindows(&argc, (char **)&hname); diff --git a/sys/share/pcmain.c b/sys/share/pcmain.c index bee05f9dc..9ef0cbf5d 100644 --- a/sys/share/pcmain.c +++ b/sys/share/pcmain.c @@ -415,18 +415,6 @@ char *argv[]; level_info[0].where = ACTIVE; #endif - /* - * Initialisation of the boundaries of the mazes - * Both boundaries have to be even. - */ - - x_maze_max = COLNO-1; - if (x_maze_max % 2) - x_maze_max--; - y_maze_max = ROWNO-1; - if (y_maze_max % 2) - y_maze_max--; - /* * Initialize the vision system. This must be before mklev() on a * new game or before a level restore on a saved game. diff --git a/sys/unix/unixmain.c b/sys/unix/unixmain.c index 81b033cef..4a70d666d 100644 --- a/sys/unix/unixmain.c +++ b/sys/unix/unixmain.c @@ -231,17 +231,6 @@ char *argv[]; dlb_init(); /* must be before newgame() */ - /* - * Initialization of the boundaries of the mazes - * Both boundaries have to be even. - */ - x_maze_max = COLNO-1; - if (x_maze_max % 2) - x_maze_max--; - y_maze_max = ROWNO-1; - if (y_maze_max % 2) - y_maze_max--; - /* * Initialize the vision system. This must be before mklev() on a * new game or before a level restore on a saved game. diff --git a/sys/vms/vmsmain.c b/sys/vms/vmsmain.c index 9c6474891..d1ab5f7d4 100644 --- a/sys/vms/vmsmain.c +++ b/sys/vms/vmsmain.c @@ -158,17 +158,6 @@ char *argv[]; dlb_init(); /* must be before newgame() */ - /* - * Initialization of the boundaries of the mazes - * Both boundaries have to be even. - */ - x_maze_max = COLNO-1; - if (x_maze_max % 2) - x_maze_max--; - y_maze_max = ROWNO-1; - if (y_maze_max % 2) - y_maze_max--; - /* * Initialize the vision system. This must be before mklev() on a * new game or before a level restore on a saved game.