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

Function lspo_levregion

src/sp_lev.c:5471–5494  ·  view source on GitHub ↗

TODO: FIXME from lev_comp SPO_LEVREGION was called as: - STAIR:(x1,y1,x2,y2),(x1,y1,x2,y2),dir - PORTAL:(x1,y1,x2,y2),(x1,y1,x2,y2),string - BRANCH:(x1,y1,x2,y2),(x1,y1,x2,y2),dir */ levregion({ region = { x1,y1, x2,y2 }, exclude = { x1,y1, x2,y2 }, * type = "portal", name="air" }); */ TODO: allow region to be optional, defaulting to whole level */

Source from the content-addressed store, hash-verified

5469 * type = "portal", name="air" }); */
5470/* TODO: allow region to be optional, defaulting to whole level */
5471int
5472lspo_levregion(lua_State *L)
5473{
5474 static const char *const regiontypes[] = {
5475 "stair-down", "stair-up", "portal", "branch",
5476 "teleport", "teleport-up", "teleport-down", NULL
5477 };
5478 static const int regiontypes2i[] = {
5479 LR_DOWNSTAIR, LR_UPSTAIR, LR_PORTAL, LR_BRANCH,
5480 LR_TELE, LR_UPTELE, LR_DOWNTELE, 0
5481 };
5482 lev_region tmplregion;
5483
5484 create_des_coder();
5485 lcheck_param_table(L);
5486 l_get_lregion(L, &tmplregion);
5487 tmplregion.rtype = regiontypes2i[get_table_option(L, "type", "stair-down",
5488 regiontypes)];
5489 tmplregion.padding = get_table_int_opt(L, "padding", 0);
5490 tmplregion.rname.str = get_table_str_opt(L, "name", NULL);
5491
5492 levregion_add(&tmplregion);
5493 return 0;
5494}
5495
5496/* exclusion({ type = "teleport", region = { x1,y1, x2,y2 } }); */
5497int

Callers

nothing calls this directly

Calls 7

create_des_coderFunction · 0.85
lcheck_param_tableFunction · 0.85
l_get_lregionFunction · 0.85
get_table_optionFunction · 0.85
get_table_int_optFunction · 0.85
get_table_str_optFunction · 0.85
levregion_addFunction · 0.85

Tested by

no test coverage detected