MCPcopy Create free account
hub / github.com/NetHack/NetHack / do_repeat

Function do_repeat

src/cmd.c:1637–1660  ·  view source on GitHub ↗

#repeat */

Source from the content-addressed store, hash-verified

1635
1636/* #repeat */
1637int
1638do_repeat(void)
1639{
1640 int res = ECMD_OK;
1641
1642 if (!gi.in_doagain) {
1643 struct _cmd_queue *repeat_copy;
1644
1645 if (!cmdq_peek(CQ_REPEAT)) {
1646 Norep("There is no command available to repeat.");
1647 return ECMD_FAIL;
1648 }
1649 repeat_copy = cmdq_copy(CQ_REPEAT);
1650 gi.in_doagain = TRUE;
1651 rhack(0); /* read and execute command */
1652 gi.in_doagain = FALSE;
1653 cmdq_clear(CQ_REPEAT);
1654 gc.command_queue[CQ_REPEAT] = repeat_copy;
1655 iflags.menu_requested = FALSE;
1656 if (svc.context.move)
1657 res = ECMD_TIME;
1658 }
1659 return res;
1660}
1661
1662/* extcmdlist: full command list, ordered by command name;
1663 commands with no keystroke or with only a meta keystroke generally

Callers

nothing calls this directly

Calls 5

cmdq_peekFunction · 0.85
NorepFunction · 0.85
cmdq_copyFunction · 0.85
rhackFunction · 0.85
cmdq_clearFunction · 0.85

Tested by

no test coverage detected