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

Function get_table_int_opt

src/nhlua.c:1028–1039  ·  view source on GitHub ↗

get optional integer value from table */

Source from the content-addressed store, hash-verified

1026
1027/* get optional integer value from table */
1028int
1029get_table_int_opt(lua_State *L, const char *name, int defval)
1030{
1031 int ret = defval;
1032
1033 lua_getfield(L, -1, name);
1034 if (!lua_isnil(L, -1)) {
1035 ret = (int) luaL_checkinteger(L, -1);
1036 }
1037 lua_pop(L, 1);
1038 return ret;
1039}
1040
1041char *
1042get_table_str(lua_State *L, const char *name)

Callers 15

init_dungeon_levelsFunction · 0.85
init_dungeon_branchesFunction · 0.85
init_dungeon_dungeonsFunction · 0.85
l_selection_gradientFunction · 0.85
get_table_xy_or_coordFunction · 0.85
lspo_monsterFunction · 0.85
lspo_objectFunction · 0.85
lspo_level_initFunction · 0.85
lspo_mineralizeFunction · 0.85
lspo_roomFunction · 0.85
lspo_goldFunction · 0.85
lspo_doorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected