check that we can write out the current level */
| 1345 | |
| 1346 | /* check that we can write out the current level */ |
| 1347 | staticfn NHFILE * |
| 1348 | currentlevel_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 |
| 1374 | void |
no test coverage detected