Fix: don't leak in_checkpoint on a failed level write.
save_currentstate() increments program_state.in_checkpoint and then returns early without decrementing it when currentlevel_rewrite() fails (full disk, quota, unwritable directory). The guard at the top of the function suppresses every later checkpoint for the rest of the game, leaving recover with nothing newer than the last checkpoint that did get written, and nothing says so.
This commit is contained in:
@@ -1385,8 +1385,10 @@ save_currentstate(void)
|
||||
if (flags.ins_chkpt) {
|
||||
/* write out just-attained level, with pets and everything */
|
||||
nhfp = currentlevel_rewrite();
|
||||
if (!nhfp)
|
||||
if (!nhfp) {
|
||||
program_state.in_checkpoint--;
|
||||
return;
|
||||
}
|
||||
if (nhfp->structlevel)
|
||||
bufon(nhfp->fd);
|
||||
nhfp->mode = WRITING;
|
||||
|
||||
Reference in New Issue
Block a user