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

Function nhl_deltrap

src/nhlua.c:470–492  ·  view source on GitHub ↗

nh.deltrap(x,y); nh.deltrap({ x = 10, y = 15 }); */

Source from the content-addressed store, hash-verified

468
469/* nh.deltrap(x,y); nh.deltrap({ x = 10, y = 15 }); */
470staticfn int
471nhl_deltrap(lua_State *L)
472{
473 lua_Integer lx, ly;
474 coordxy x, y;
475
476 if (!nhl_get_xy_params(L, &lx, &ly)) {
477 nhl_error(L, "Incorrect arguments");
478 /*NOTREACHED*/
479 return 0;
480 }
481 x = (coordxy) lx;
482 y = (coordxy) ly;
483 cvt_to_abscoord(&x, &y);
484
485 if (isok(x, y)) {
486 struct trap *ttmp = t_at(x, y);
487
488 if (ttmp)
489 deltrap(ttmp);
490 }
491 return 0;
492}
493
494RESTORE_WARNING_UNREACHABLE_CODE
495

Callers

nothing calls this directly

Calls 6

nhl_get_xy_paramsFunction · 0.85
nhl_errorFunction · 0.85
cvt_to_abscoordFunction · 0.85
isokFunction · 0.85
t_atFunction · 0.85
deltrapFunction · 0.85

Tested by

no test coverage detected