Permalink
Browse files

Move mazewalkmap code near other debug cmd code

Closes #5.
  • Loading branch information...
1 parent 019a449 commit 8a851133ed954d08f4aefb9a2ec76c44a0af5a17 @tung committed Apr 7, 2012
Showing with 23 additions and 22 deletions.
  1. +23 −22 libnitrohack/src/cmd.c
View
@@ -88,7 +88,6 @@ const struct cmd_desc cmdlist[] = {
{"license", "show the NitroHack license", 0, 0, TRUE, dolicense, CMD_ARG_NONE | CMD_HELP | CMD_NOTIME},
{"lookhere", "describe the current square", ':', 0, TRUE, dolook, CMD_ARG_NONE | CMD_NOTIME},
{"loot", "loot a bag or box on the floor", M('l'), 'l', FALSE, doloot, CMD_ARG_NONE | CMD_EXT},
- {"mazewalkmap", "show MAZEWALK paths", 0, 0, TRUE, wiz_mazewalkmap, CMD_ARG_NONE | CMD_DEBUG | CMD_EXT | CMD_NOTIME},
{"menuinv", "show a partial inventory", 'I', 0, TRUE, dotypeinv, CMD_ARG_NONE | CMD_NOTIME},
{"monster", "use a monster's special ability", 'M', M('m'), TRUE, domonability, CMD_ARG_NONE | CMD_EXT},
{"multidrop", "drop multiple items", 'D', 0, FALSE, doddrop, CMD_ARG_NONE},
@@ -150,6 +149,7 @@ const struct cmd_desc cmdlist[] = {
{"levelteleport", "(DEBUG) telport to a different level", C('v'), 0, TRUE, wiz_level_tele, CMD_ARG_NONE | CMD_DEBUG},
{"levelchange", "(DEBUG) change experience level", 0, 0, TRUE, wiz_level_change, CMD_ARG_NONE | CMD_DEBUG | CMD_EXT},
{"lightsources", "(DEBUG) show mobile light sources", 0, 0, TRUE, wiz_light_sources, CMD_ARG_NONE | CMD_DEBUG | CMD_EXT | CMD_NOTIME},
+ {"mazewalkmap", "(DEBUG) show MAZEWALK paths", 0, 0, TRUE, wiz_mazewalkmap, CMD_ARG_NONE | CMD_DEBUG | CMD_EXT | CMD_NOTIME},
{"monpolycontrol", "(DEBUG) control monster polymorphs", 0, 0, TRUE, wiz_mon_polycontrol, CMD_ARG_NONE | CMD_DEBUG | CMD_EXT},
{"panic", "(DEBUG) test panic routine (fatal to game)", 0, 0, TRUE, wiz_panic, CMD_ARG_NONE | CMD_DEBUG | CMD_EXT},
{"polyself", "(DEBUG) polymorph self", 0, 0, TRUE, wiz_polyself, CMD_ARG_NONE | CMD_DEBUG | CMD_EXT},
@@ -505,6 +505,28 @@ static int wiz_show_wmodes(void)
return 0;
}
+/* #mazewalkmap command */
+static int wiz_mazewalkmap(void)
+{
+ struct menulist menu;
+ int x, y;
+ char row[COLNO+1];
+
+ init_menulist(&menu);
+
+ for (y = 0; y < ROWNO; y++) {
+ for (x = 0; x < COLNO; x++)
+ row[x] = SpLev_Map[x][y] ? '1' : '.';
+ if (y == u.uy)
+ row[u.ux] = '@';
+ row[x] = '\0';
+ add_menutext(&menu, row);
+ }
+ display_menu(menu.items, menu.icount, NULL, PICK_NONE, NULL);
+ free(menu.items);
+ return 0;
+}
+
/* -enlightenment and conduct- */
static const char
@@ -1407,27 +1429,6 @@ static void mon_chain(struct menulist *menu, const char *src, struct monst *chai
add_menutext(menu, buf);
}
-static int wiz_mazewalkmap(void)
-{
- struct menulist menu;
- int x, y;
- char row[COLNO+1];
-
- init_menulist(&menu);
-
- for (y = 0; y < ROWNO; y++) {
- for (x = 0; x < COLNO; x++)
- row[x] = SpLev_Map[x][y] ? '1' : '.';
- if (y == u.uy)
- row[u.ux] = '@';
- row[x] = '\0';
- add_menutext(&menu, row);
- }
- display_menu(menu.items, menu.icount, NULL, PICK_NONE, NULL);
- free(menu.items);
- return 0;
-}
-
/*
* Display memory usage of all monsters and objects on the level.
*/

0 comments on commit 8a85113

Please sign in to comment.