Skip to content

Commit

Permalink
Don't call dump_everything() if startscummed
Browse files Browse the repository at this point in the history
Followup to c3f35e0: After that commit the game shouldn't have written
to a dumplog file under those circumstances anyway (dump_open_log was
already skipped if 'startscummed' was set, so dump_everything ought to
have just returned early after finding neither 'dumplog_file' nor
'dumphtml_file'), but still better to be explicit and not rely solely on
dump_everything.  Also add a comment explaining why the change was made.
  • Loading branch information
entrez committed Nov 13, 2024
1 parent c3f35e0 commit 3b9a5d9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/end.c
Original file line number Diff line number Diff line change
Expand Up @@ -1308,7 +1308,10 @@ int how;
#endif
/* END TNNT code */

/* Don't produce a dumplog for scummed games */
/* TNNT: Don't produce a dumplog for scummed games. All the writes were
* contributing to serious server load when players were startscumming at
* an extremely rapid pace (whether violating the rules by using a script,
* or just quitting and restarting games very quickly by hand). */
startscummed = ((how == QUIT || how == ESCAPED) && moves <= 100L);

if (!startscummed)
Expand Down Expand Up @@ -1410,7 +1413,8 @@ int how;
if (strcmp(flags.end_disclose, "none"))
disclose(how, taken);

dump_everything(how, endtime);
if (!startscummed)
dump_everything(how, endtime);
}

/* if pets will contribute to score, populate mydogs list now
Expand Down

0 comments on commit 3b9a5d9

Please sign in to comment.