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

Function currentlevel_rewrite

src/do.c:1347–1371  ·  view source on GitHub ↗

check that we can write out the current level */

Source from the content-addressed store, hash-verified

1345
1346/* check that we can write out the current level */
1347staticfn NHFILE *
1348currentlevel_rewrite(void)
1349{
1350 NHFILE *nhfp;
1351 char whynot[BUFSZ];
1352
1353 /* since level change might be a bit slow, flush any buffered screen
1354 * output (like "you fall through a trap door") */
1355 mark_synch();
1356
1357 nhfp = create_levelfile(ledger_no(&u.uz), whynot);
1358 if (!nhfp) {
1359 /*
1360 * This is not quite impossible: e.g., we may have
1361 * exceeded our quota. If that is the case then we
1362 * cannot leave this level, and cannot save either.
1363 * Another possibility is that the directory was not
1364 * writable.
1365 */
1366 pline1(whynot);
1367 return (NHFILE *) 0;
1368 }
1369
1370 return nhfp;
1371}
1372
1373#ifdef INSURANCE
1374void

Callers 2

save_currentstateFunction · 0.85
goto_levelFunction · 0.85

Calls 2

create_levelfileFunction · 0.85
ledger_noFunction · 0.85

Tested by

no test coverage detected