after getlev(), put current level into a level/lock file; essential when splitting a save file into individual level files */ ARGSUSED*/
| 752 | essential when splitting a save file into individual level files */ |
| 753 | /*ARGSUSED*/ |
| 754 | staticfn int |
| 755 | restlevelfile(xint8 ltmp) |
| 756 | { |
| 757 | char whynot[BUFSZ]; |
| 758 | NHFILE *nhfp = (NHFILE *) 0; |
| 759 | |
| 760 | nhfp = create_levelfile(ltmp, whynot); |
| 761 | if (!nhfp) { |
| 762 | /* failed to create a new file; don't attempt to make a panic save */ |
| 763 | program_state.something_worth_saving = 0; |
| 764 | panic("restlevelfile: %s", whynot); |
| 765 | } |
| 766 | bufon(nhfp->fd); |
| 767 | nhfp->mode = WRITING | FREEING; |
| 768 | savelev(nhfp, ltmp); |
| 769 | close_nhfile(nhfp); |
| 770 | return 2; |
| 771 | } |
| 772 | |
| 773 | /* |
| 774 | * restore_saved_game() prior to this left us at this position in |
no test coverage detected