-/* NetHack 3.6 winmisc.c $NHDT-Date: 1539892610 2018/10/18 19:56:50 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.39 $ */
+/* NetHack 3.6 winmisc.c $NHDT-Date: 1543830350 2018/12/03 09:45:50 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.42 $ */
/* Copyright (c) Dean Luick, 1992 */
/* NetHack may be freely redistributed. See license for details. */
ec_nchars = 1;
}
for (i = 0; extcmdlist[i].ef_txt; i++) {
+ if (extcmdlist[i].flags & CMD_NOT_AVAILABLE)
+ continue;
if (extcmdlist[i].ef_txt[0] == '?')
continue;
static void
init_extended_commands_popup()
{
- int i, num_commands;
+ int i, j, num_commands, ignore_cmds = 0;
const char **command_list;
/* count commands */
for (num_commands = 0; extcmdlist[num_commands].ef_txt; num_commands++)
- ; /* do nothing */
+ if (extcmdlist[num_commands].flags & CMD_NOT_AVAILABLE)
+ ++ignore_cmds;
/* If the last entry is "help", don't use it. */
if (strcmp(extcmdlist[num_commands - 1].ef_txt, "?") == 0)
--num_commands;
- command_list =
- (const char **) alloc((unsigned) num_commands * sizeof(char *));
+ j = num_commands - ignore_cmds;
+ command_list = (const char **) alloc((unsigned) j * sizeof (char *));
- for (i = 0; i < num_commands; i++)
- command_list[i] = extcmdlist[i].ef_txt;
+ for (i = j = 0; i < num_commands; i++) {
+ if (extcmdlist[i].flags & CMD_NOT_AVAILABLE)
+ continue;
+ command_list[j++] = extcmdlist[i].ef_txt;
+ }
+ num_commands = j;
extended_command_popup =
make_menu("extended_commands", "Extended Commands",
-/* NetHack 3.6 getline.c $NHDT-Date: 1523619111 2018/04/13 11:31:51 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.35 $ */
+/* NetHack 3.6 getline.c $NHDT-Date: 1543830347 2018/12/03 09:45:47 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.37 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Michael Allison, 2006. */
/* NetHack may be freely redistributed. See license for details. */
com_index = -1;
for (oindex = 0; extcmdlist[oindex].ef_txt != (char *) 0; oindex++) {
+ if (extcmdlist[oindex].flags & CMD_NOT_AVAILABLE)
+ continue;
if ((extcmdlist[oindex].flags & AUTOCOMPLETE)
&& !(!wizard && (extcmdlist[oindex].flags & WIZMODECMD))
&& !strncmpi(base, extcmdlist[oindex].ef_txt, strlen(base))) {