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

Function savelev

src/save.c:428–449  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

426#endif
427
428void
429savelev(NHFILE *nhfp, xint8 lev)
430{
431 boolean set_uz_save = (gu.uz_save.dnum == 0 && gu.uz_save.dlevel == 0);
432
433 /* caller might have already set up gu.uz_save and zeroed u.uz;
434 if not, we need to set it for save_bubbles(); caveat: if the
435 player quits during character selection, u.uz won't be set yet
436 but we'll be called during run-down */
437 if (set_uz_save && (nhfp->mode & (COUNTING | WRITING))) {
438 if (u.uz.dnum == 0 && u.uz.dlevel == 0) {
439 program_state.something_worth_saving = 0;
440 panic("savelev: where are we?");
441 }
442 gu.uz_save = u.uz;
443 }
444
445 savelev_core(nhfp, lev);
446
447 if (set_uz_save)
448 gu.uz_save.dnum = gu.uz_save.dlevel = 0; /* unset */
449}
450
451staticfn void
452savelev_core(NHFILE *nhfp, xint8 lev)

Callers 7

savebonesFunction · 0.85
save_currentstateFunction · 0.85
goto_levelFunction · 0.85
restlevelfileFunction · 0.85
dorecoverFunction · 0.85
dosave0Function · 0.85
makemap_prepostFunction · 0.85

Calls 2

savelev_coreFunction · 0.85
panicFunction · 0.50

Tested by

no test coverage detected