Skip to content

Commit 55c3274

Browse files
author
Alex Smith
committed
Fix the debug log to reflect the new method of writing save files
This goes together with the previous commit, but is a fix to a feature that's very rarely used (it's intended for developers debugging the save code), and thus probably won't affect most people.
1 parent 01f256f commit 55c3274

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

libnethack/src/memfile.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,12 +514,18 @@ mdiffwritecmd(struct memfile *mf, struct mdiff_command_instance *mdci)
514514
mdiff_command_sizes[mdci->command].name,
515515
(int_least64_t)mdci->arg1, (uint_least64_t)mdci->arg2);
516516

517-
i = usedbytes*8;
517+
i = (usedbytes - splitbytes) * 8;
518518
while (i--) {
519519
fprintf(debuglog, "%d", (int)(1 & (encoding >> i)));
520520
if (i && !(i%8))
521521
fprintf(debuglog, " ");
522522
}
523+
i = splitbytes * 8;
524+
while (i--) {
525+
fprintf(debuglog, "%d", (int)(1 & (arg1_2c >> i)));
526+
if (i && !(i%8))
527+
fprintf(debuglog, " ");
528+
}
523529
}
524530

525531
/* Record that this command appears in the diff. */

0 commit comments

Comments
 (0)