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

Function l_push_mkroom_table

src/sp_lev.c:3058–3070  ·  view source on GitHub ↗

push a table on lua stack containing room data */

Source from the content-addressed store, hash-verified

3056
3057/* push a table on lua stack containing room data */
3058staticfn void
3059l_push_mkroom_table(lua_State *L, struct mkroom *tmpr)
3060{
3061 lua_newtable(L);
3062 nhl_add_table_entry_int(L, "width", 1 + (tmpr->hx - tmpr->lx));
3063 nhl_add_table_entry_int(L, "height", 1 + (tmpr->hy - tmpr->ly));
3064 nhl_add_table_entry_region(L, "region", tmpr->lx, tmpr->ly,
3065 tmpr->hx, tmpr->hy);
3066 nhl_add_table_entry_bool(L, "lit", (boolean) tmpr->rlit);
3067 nhl_add_table_entry_bool(L, "irregular", tmpr->irregular);
3068 nhl_add_table_entry_bool(L, "needjoining", tmpr->needjoining);
3069 nhl_add_table_entry_str(L, "type", get_mkroom_name(tmpr->rtype));
3070}
3071
3072DISABLE_WARNING_UNREACHABLE_CODE
3073

Callers 2

lspo_roomFunction · 0.85
lspo_regionFunction · 0.85

Calls 5

nhl_add_table_entry_intFunction · 0.85
nhl_add_table_entry_boolFunction · 0.85
nhl_add_table_entry_strFunction · 0.85
get_mkroom_nameFunction · 0.85

Tested by

no test coverage detected