MCPcopy Index your code
hub / github.com/NetHack/NetHack / doextcmd

Function doextcmd

src/cmd.c:492–520  ·  view source on GitHub ↗

here after # - now read a full-word command */

Source from the content-addressed store, hash-verified

490
491/* here after # - now read a full-word command */
492int
493doextcmd(void)
494{
495 int idx, retval;
496 int (*func)(void);
497
498 /* keep repeating until we don't run help or quit */
499 do {
500 idx = get_ext_cmd();
501 if (idx < 0)
502 return ECMD_OK; /* quit */
503
504 func = extcmdlist[idx].ef_funct;
505 if (!can_do_extcmd(&extcmdlist[idx]))
506 return ECMD_OK;
507 if (iflags.menu_requested && !accept_menu_prefix(&extcmdlist[idx])) {
508 pline("'%s' prefix has no effect for the %s command.",
509 visctrl(cmd_from_func(do_reqmenu)),
510 extcmdlist[idx].ef_txt);
511 iflags.menu_requested = FALSE;
512 }
513 /* tell rhack() what command is actually executing */
514 ge.ext_tlist = &extcmdlist[idx];
515
516 retval = (*func)();
517 } while (func == doextlist);
518
519 return retval;
520}
521
522/* format extended command flags for display */
523staticfn char *

Callers

nothing calls this directly

Calls 5

can_do_extcmdFunction · 0.85
accept_menu_prefixFunction · 0.85
visctrlFunction · 0.85
cmd_from_funcFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected