MCPcopy Index your code
hub / github.com/NetHack/NetHack / load_special

Function load_special

src/sp_lev.c:6453–6502  ·  view source on GitHub ↗

* General loader */

Source from the content-addressed store, hash-verified

6451 * General loader
6452 */
6453boolean
6454load_special(const char *name)
6455{
6456 boolean result = FALSE;
6457 nhl_sandbox_info sbi = {NHL_SB_SAFE, 1*1024*1024, 0, 1*1024*1024};
6458
6459 create_des_coder();
6460
6461 if (!load_lua(name, &sbi))
6462 goto give_up;
6463
6464 link_doors_rooms();
6465 remove_boundary_syms();
6466
6467 /* TODO: ensure_way_out() needs rewrite */
6468 if (gc.coder->check_inaccessibles)
6469 ensure_way_out();
6470
6471 map_cleanup();
6472
6473 /* FIXME: Ideally, we want this call to only cover areas of the map
6474 * which were not inserted directly by the special level file (see
6475 * the insect legs on Baalzebub's level, for instance). Since that
6476 * is currently not possible, we overload the corrmaze flag for this
6477 * purpose.
6478 */
6479 if (!svl.level.flags.corrmaze)
6480 wallification(1, 0, COLNO - 1, ROWNO - 1);
6481
6482 flip_level_rnd(gc.coder->allow_flips, FALSE);
6483
6484 count_level_features();
6485
6486 if (gc.coder->solidify)
6487 solidify_map();
6488
6489 /* This must be done before premap_detect(),
6490 * otherwise branch stairs won't be premapped. */
6491 fixup_special();
6492
6493 if (gc.coder->premapped)
6494 premap_detect();
6495
6496 result = TRUE;
6497 give_up:
6498 Free(gc.coder);
6499 gc.coder = NULL;
6500
6501 return result;
6502}
6503
6504/*sp_lev.c*/

Callers 2

wiz_load_spluaFunction · 0.85
makemazFunction · 0.85

Calls 12

create_des_coderFunction · 0.85
load_luaFunction · 0.85
link_doors_roomsFunction · 0.85
remove_boundary_symsFunction · 0.85
ensure_way_outFunction · 0.85
map_cleanupFunction · 0.85
wallificationFunction · 0.85
flip_level_rndFunction · 0.85
count_level_featuresFunction · 0.85
solidify_mapFunction · 0.85
fixup_specialFunction · 0.85
premap_detectFunction · 0.85

Tested by

no test coverage detected