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

Function cmdq_shift

src/cmd.c:354–370  ·  view source on GitHub ↗

shift the last entry in command queue to first */

Source from the content-addressed store, hash-verified

352
353/* shift the last entry in command queue to first */
354void
355cmdq_shift(int q)
356{
357 struct _cmd_queue *tmp = NULL;
358 struct _cmd_queue *cq = gc.command_queue[q];
359
360 while (cq && cq->next && cq->next->next)
361 cq = cq->next;
362
363 if (cq)
364 tmp = cq->next;
365 if (tmp) {
366 tmp->next = gc.command_queue[q];
367 gc.command_queue[q] = tmp;
368 cq->next = NULL;
369 }
370}
371
372struct _cmd_queue *
373cmdq_reverse(struct _cmd_queue *head)

Callers 1

rhackFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected