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

Function get_table_intarray_entry

src/sp_lev.c:5259–5279  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5257DISABLE_WARNING_UNREACHABLE_CODE
5258
5259staticfn lua_Integer
5260get_table_intarray_entry(lua_State *L, int tableidx, int entrynum)
5261{
5262 lua_Integer ret = 0;
5263 if (tableidx < 0)
5264 tableidx--;
5265
5266 lua_pushinteger(L, entrynum);
5267 lua_gettable(L, tableidx);
5268 if (lua_isnumber(L, -1)) {
5269 ret = lua_tointeger(L, -1);
5270 } else {
5271 char buf[BUFSZ];
5272
5273 Sprintf(buf, "Array entry #%i is %s, expected number",
5274 1, luaL_typename(L, -1));
5275 nhl_error(L, buf);
5276 }
5277 lua_pop(L, 1);
5278 return ret;
5279}
5280
5281staticfn int
5282get_table_region(

Callers 2

get_table_regionFunction · 0.85
get_coordFunction · 0.85

Calls 1

nhl_errorFunction · 0.85

Tested by

no test coverage detected