Skip to content

Commit c6950ab

Browse files
committed
Suppress livelogging whilst in explore mode.
1 parent f446664 commit c6950ab

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

doc/evilhack-changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3419,4 +3419,5 @@ The following changes to date are:
34193419
in pools/moats
34203420
- New spells - burning hands, shocking grasp
34213421
- Fix: repair armor spell will not randomly target the Hand of Vecna
3422+
- Suppress livelogging whilst in explore mode
34223423

src/files.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4688,15 +4688,21 @@ const char *buffer;
46884688
#define LLOG_SEP '\t' /* livelog field separator */
46894689
FILE* livelogfile;
46904690

4691-
if(!(ll_type & sysopt.livelog)) return;
4692-
if((ll_type == LL_CONDUCT) && (moves < sysopt.ll_conduct_turns)) return;
4693-
if(lock_file(LIVELOGFILE, SCOREPREFIX, 10)) {
4694-
if(!(livelogfile = fopen_datafile(LIVELOGFILE, "a", SCOREPREFIX))) {
4691+
if (!(ll_type & sysopt.livelog))
4692+
return;
4693+
if ((ll_type == LL_CONDUCT)
4694+
&& (moves < sysopt.ll_conduct_turns))
4695+
return;
4696+
if (discover) /* don't livelog in explore mode */
4697+
return;
4698+
if (lock_file(LIVELOGFILE, SCOREPREFIX, 10)) {
4699+
if (!(livelogfile = fopen_datafile(LIVELOGFILE, "a", SCOREPREFIX))) {
46954700
pline("Cannot open live log file!");
46964701
} else {
46974702
char tmpbuf[1024+1];
46984703
char msgbuf[512+1];
46994704
char *c1 = msgbuf;
4705+
47004706
strncpy(msgbuf, buffer, 512);
47014707
msgbuf[512] = '\0';
47024708
while (*c1 != '\0') {
@@ -4719,9 +4725,9 @@ const char *buffer;
47194725
moves,
47204726
LLOG_SEP,
47214727
urealtime.realtime + (getnow() - urealtime.start_timing), LLOG_SEP,
4722-
(long)ubirthday,
4728+
(long) ubirthday,
47234729
LLOG_SEP,
4724-
(long)time(NULL),
4730+
(long) time(NULL),
47254731
LLOG_SEP,
47264732
msgbuf);
47274733

0 commit comments

Comments
 (0)