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

Function lspo_teleport_region

src/sp_lev.c:5442–5460  ·  view source on GitHub ↗

teleport_region({ region = { x1,y1, x2,y2 } }); */ teleport_region({ region = { x1,y1, x2,y2 }, [ region_islev = 1, ] * exclude = { x1,y1, x2,y2 }, [ exclude_islen = 1, ] [ dir = "up" ] }); */ TODO: maybe allow using selection, with a new method "getextents()"? */

Source from the content-addressed store, hash-verified

5440 * exclude = { x1,y1, x2,y2 }, [ exclude_islen = 1, ] [ dir = "up" ] }); */
5441/* TODO: maybe allow using selection, with a new method "getextents()"? */
5442int
5443lspo_teleport_region(lua_State *L)
5444{
5445 static const char *const teledirs[] = { "both", "down", "up", NULL };
5446 static const int teledirs2i[] = { LR_TELE, LR_DOWNTELE, LR_UPTELE, -1 };
5447 lev_region tmplregion;
5448
5449 create_des_coder();
5450 lcheck_param_table(L);
5451 l_get_lregion(L, &tmplregion);
5452 tmplregion.rtype = teledirs2i[get_table_option(L, "dir", "both",
5453 teledirs)];
5454 tmplregion.padding = 0;
5455 tmplregion.rname.str = NULL;
5456
5457 levregion_add(&tmplregion);
5458
5459 return 0;
5460}
5461
5462/* TODO: FIXME
5463 from lev_comp SPO_LEVREGION was called as:

Callers

nothing calls this directly

Calls 5

create_des_coderFunction · 0.85
lcheck_param_tableFunction · 0.85
l_get_lregionFunction · 0.85
get_table_optionFunction · 0.85
levregion_addFunction · 0.85

Tested by

no test coverage detected