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

Function save_currentstate

src/do.c:1374–1395  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1372
1373#ifdef INSURANCE
1374void
1375save_currentstate(void)
1376{
1377 NHFILE *nhfp;
1378
1379 program_state.in_checkpoint++;
1380 if (flags.ins_chkpt) {
1381 /* write out just-attained level, with pets and everything */
1382 nhfp = currentlevel_rewrite();
1383 if (!nhfp)
1384 return;
1385 if (nhfp->structlevel)
1386 bufon(nhfp->fd);
1387 nhfp->mode = WRITING;
1388 savelev(nhfp,ledger_no(&u.uz));
1389 close_nhfile(nhfp);
1390 }
1391
1392 /* write out non-level state */
1393 savestateinlock();
1394 program_state.in_checkpoint--;
1395}
1396#endif
1397
1398/*

Callers 5

qt_timer_fireFunction · 0.85
default_checkinputFunction · 0.85
newgameFunction · 0.85
goto_levelFunction · 0.85
makemap_prepostFunction · 0.85

Calls 6

currentlevel_rewriteFunction · 0.85
bufonFunction · 0.85
savelevFunction · 0.85
ledger_noFunction · 0.85
close_nhfileFunction · 0.85
savestateinlockFunction · 0.85

Tested by

no test coverage detected