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

Function l_table_getset_feature_flag

src/sp_lev.c:4738–4755  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4736RESTORE_WARNING_UNREACHABLE_CODE
4737
4738staticfn void
4739l_table_getset_feature_flag(
4740 lua_State *L,
4741 int x, int y,
4742 const char *name,
4743 int flag)
4744{
4745 int val = get_table_boolean_opt(L, name, -2);
4746
4747 if (val != -2) {
4748 if (val == -1)
4749 val = rn2(2);
4750 if (val)
4751 levl[x][y].flags |= flag;
4752 else
4753 levl[x][y].flags &= ~flag;
4754 }
4755}
4756
4757/* guts of nhl_abs_coord; convert a coordinate relative to a map or room
4758 * into an absolute coordinate in svl.level.locations.

Callers 1

lspo_featureFunction · 0.85

Calls 2

get_table_boolean_optFunction · 0.85
rn2Function · 0.85

Tested by

no test coverage detected