fix github issue #687 - logging of major events
Reported by k21971, the dumplog section labeled "major events" showed all logged events rather than just the ones classified as major. Filter out the non-major ones when writing dumplog. At the moment only a couple of ones other than achievements are major. Probably various other types should be too. The #chronicle command still lists all logged events unless they're flagged as 'spoiler'. So far the mines' end luckstone is the only one flagged that way. Unfortunately a player with access to live logging could still learn whether or not the gray stone that has just been picked up on the last mines level is the target luckstone by viewing the log from outside of the game. The #chronicle command would be more useful if it gathered all the categories of events present and put up a menu allowing the player to choose which ones to view. I haven't attempted to implement that. Closes #687
This commit is contained in:
32
src/cmd.c
32
src/cmd.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.7 cmd.c $NHDT-Date: 1644610344 2022/02/11 20:12:24 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.519 $ */
|
||||
/* NetHack 3.7 cmd.c $NHDT-Date: 1646136938 2022/03/01 12:15:38 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.528 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2013. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -850,36 +850,6 @@ enter_explore_mode(void)
|
||||
return ECMD_OK;
|
||||
}
|
||||
|
||||
int
|
||||
do_gamelog(void)
|
||||
{
|
||||
#ifdef CHRONICLE
|
||||
struct gamelog_line *tmp = g.gamelog;
|
||||
winid win;
|
||||
char buf[BUFSZ];
|
||||
|
||||
if (!tmp) {
|
||||
pline("No chronicled events.");
|
||||
return ECMD_OK;
|
||||
}
|
||||
|
||||
win = create_nhwindow(NHW_TEXT);
|
||||
putstr(win, 0, "Major events:");
|
||||
putstr(win, 0, "");
|
||||
putstr(win, 0, " Turn");
|
||||
while (tmp) {
|
||||
Sprintf(buf, "%5li: %s", tmp->turn, tmp->text);
|
||||
putstr(win, 0, buf);
|
||||
tmp = tmp->next;
|
||||
}
|
||||
display_nhwindow(win, TRUE);
|
||||
destroy_nhwindow(win);
|
||||
#else
|
||||
pline("Chronicle was turned off during compile-time.");
|
||||
#endif /* !CHRONICLE */
|
||||
return ECMD_OK;
|
||||
}
|
||||
|
||||
/* #wizwish command - wish for something */
|
||||
static int
|
||||
wiz_wish(void) /* Unlimited wishes for debug mode by Paul Polderman */
|
||||
|
||||
Reference in New Issue
Block a user