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

Function cmdq_add_dir

src/cmd.c:293–312  ·  view source on GitHub ↗

add a direction to the command queue */

Source from the content-addressed store, hash-verified

291
292/* add a direction to the command queue */
293void
294cmdq_add_dir(int q, schar dx, schar dy, schar dz)
295{
296 struct _cmd_queue *tmp = (struct _cmd_queue *) alloc(sizeof *tmp);
297 struct _cmd_queue *cq = gc.command_queue[q];
298
299 tmp->typ = CMDQ_DIR;
300 tmp->dirx = dx;
301 tmp->diry = dy;
302 tmp->dirz = dz;
303 tmp->next = NULL;
304
305 while (cq && cq->next)
306 cq = cq->next;
307
308 if (cq)
309 cq->next = tmp;
310 else
311 gc.command_queue[q] = tmp;
312}
313
314/* add placeholder to the command queue, allows user input there */
315void

Callers 2

doopen_indirFunction · 0.85
act_on_actFunction · 0.85

Calls 1

allocFunction · 0.70

Tested by

no test coverage detected