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

Function lspo_finalize_level

src/sp_lev.c:6013–6064  ·  view source on GitHub ↗

finalize_level is only needed for testing purposes */

Source from the content-addressed store, hash-verified

6011
6012/* finalize_level is only needed for testing purposes */
6013int
6014lspo_finalize_level(lua_State *L)
6015{
6016 boolean wtower = In_W_tower(u.ux, u.uy, &u.uz);
6017 int i;
6018
6019 if (L)
6020 create_des_coder();
6021
6022 link_doors_rooms();
6023 remove_boundary_syms();
6024
6025 /* TODO: ensure_way_out() needs rewrite */
6026 if (L && gc.coder->check_inaccessibles)
6027 ensure_way_out();
6028
6029 map_cleanup();
6030
6031 /* FIXME: Ideally, we want this call to only cover areas of the map
6032 * which were not inserted directly by the special level file (see
6033 * the insect legs on Baalzebub's level, for instance). Since that
6034 * is currently not possible, we overload the corrmaze flag for this
6035 * purpose.
6036 */
6037 if (!svl.level.flags.corrmaze)
6038 wallification(1, 0, COLNO - 1, ROWNO - 1);
6039
6040 if (L)
6041 flip_level_rnd(gc.coder->allow_flips, FALSE);
6042
6043 count_level_features();
6044
6045 if (L && gc.coder->solidify)
6046 solidify_map();
6047
6048 /* This must be done before premap_detect(),
6049 * otherwise branch stairs won't be premapped. */
6050 fixup_special();
6051
6052 if (L && gc.coder->premapped)
6053 premap_detect();
6054
6055 level_finalize_topology();
6056
6057 for (i = 0; i < svn.nroom; ++i) {
6058 fill_special_room(&svr.rooms[i]);
6059 }
6060
6061 makemap_prepost(FALSE, wtower);
6062 iflags.lua_testing = FALSE;
6063 return 0;
6064}
6065
6066DISABLE_WARNING_UNREACHABLE_CODE
6067

Callers 1

wiz_load_spluaFunction · 0.85

Calls 15

In_W_towerFunction · 0.85
create_des_coderFunction · 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