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

Function lspo_corridor

src/sp_lev.c:4524–4554  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4522}
4523
4524RESTORE_WARNING_UNREACHABLE_CODE
4525
4526/* corridor({ srcroom=1, srcdoor=2, srcwall="north",
4527 * destroom=2, destdoor=1, destwall="west" }); */
4528int
4529lspo_corridor(lua_State *L)
4530{
4531 static const char *const walldirs[] = {
4532 "all", "random", "north", "west", "east", "south", NULL
4533 };
4534 static const int walldirs2i[] = {
4535 W_ANY, W_RANDOM, W_NORTH, W_WEST, W_EAST, W_SOUTH, 0
4536 };
4537 corridor tc;
4538
4539 create_des_coder();
4540
4541 lcheck_param_table(L);
4542
4543 tc.src.room = get_table_int(L, "srcroom");
4544 tc.src.door = get_table_int(L, "srcdoor");
4545 tc.src.wall = walldirs2i[get_table_option(L, "srcwall", "all", walldirs)];
4546 tc.dest.room = get_table_int(L, "destroom");
4547 tc.dest.door = get_table_int(L, "destdoor");
4548 tc.dest.wall = walldirs2i[get_table_option(L, "destwall", "all",
4549 walldirs)];
4550
4551 create_corridor(&tc);
4552
4553 return 0;
4554}
4555
4556/* random_corridors(); */
4557int

Callers

nothing calls this directly

Calls 5

create_des_coderFunction · 0.85
lcheck_param_tableFunction · 0.85
get_table_intFunction · 0.85
get_table_optionFunction · 0.85
create_corridorFunction · 0.85

Tested by

no test coverage detected