MCPcopy Create free account
hub / github.com/crawl/crawl / _post_init

Function _post_init

crawl-ref/source/startup.cc:252–410  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

250}
251
252static void _post_init(bool newc)
253{
254 ASSERT(strwidth(you.your_name) <= MAX_NAME_LENGTH);
255
256 // XXX: now that the player is loaded, do a layout.
257 // This is necessary to ensure that the message window is positioned, in
258 // case there are any early game warning messages to be logged.
259#ifdef USE_TILE
260 tiles.resize();
261
262#ifdef USE_TILE_WEB
263 if (!newc)
264 sync_last_milestone();
265#endif
266#endif
267
268 clua.load_persist();
269
270 // Load macros
271 macro_init();
272
273 crawl_state.need_save = crawl_state.game_started = true;
274 crawl_state.last_type = crawl_state.type;
275 crawl_state.marked_as_won = false;
276
277 destroy_abyss();
278
279 calc_hp();
280 calc_mp();
281 shopping_list.refresh();
282 populate_sets_by_obj_type();
283
284 run_map_local_preludes();
285
286 if (newc)
287 {
288 // n.b. temple already generated in setup_game at this point
289 if (Options.pregen_dungeon == level_gen_type::full
290 && crawl_state.game_has_random_floors())
291 {
292 pregen_dungeon(level_id(NUM_BRANCHES, -1));
293 }
294
295 you.entering_level = false;
296 you.transit_stair = DNGN_UNSEEN;
297 you.depth = starting_absdepth() + 1;
298 you.where_are_you = root_branch;
299 if (you.depth > 1)
300 set_shafted();
301 }
302
303 // XXX: Any invalid level_id should do.
304 level_id old_level;
305 old_level.branch = NUM_BRANCHES;
306
307#ifdef USE_TILE_WEB
308 if (tiles.get_ui_state() == UI_CRT)
309 tiles.set_ui_state(UI_NORMAL);

Callers 1

startup_stepFunction · 0.85

Calls 15

strwidthFunction · 0.85
sync_last_milestoneFunction · 0.85
macro_initFunction · 0.85
destroy_abyssFunction · 0.85
calc_hpFunction · 0.85
calc_mpFunction · 0.85
run_map_local_preludesFunction · 0.85
pregen_dungeonFunction · 0.85
starting_absdepthFunction · 0.85
set_shaftedFunction · 0.85
load_levelFunction · 0.85

Tested by

no test coverage detected