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

Function nhl_test

src/nhlua.c:1399–1419  ·  view source on GitHub ↗

test( { x = 123, y = 456 } ); */

Source from the content-addressed store, hash-verified

1397 test( { x = 123, y = 456 } );
1398*/
1399staticfn int
1400nhl_test(lua_State *L)
1401{
1402 coordxy x, y;
1403 char *name, Player[] = "Player";
1404
1405 /* discard any extra arguments passed in */
1406 lua_settop(L, 1);
1407
1408 luaL_checktype(L, 1, LUA_TTABLE);
1409
1410 x = (coordxy) get_table_int(L, "x");
1411 y = (coordxy) get_table_int(L, "y");
1412 name = get_table_str_opt(L, "name", Player);
1413
1414 pline("TEST:{ x=%i, y=%i, name=\"%s\" }", (int) x, (int) y, name);
1415
1416 free(name);
1417
1418 return 1;
1419}
1420
1421/* push a key into command queue */
1422/* nh.pushkey("i"); */

Callers

nothing calls this directly

Calls 3

get_table_intFunction · 0.85
get_table_str_optFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected