]> granicus.if.org Git - nethack/commitdiff
Save playmode in xlogfile
authorPasi Kallinen <paxed@alt.org>
Sun, 29 Mar 2015 11:56:23 +0000 (14:56 +0300)
committerPasi Kallinen <paxed@alt.org>
Sun, 29 Mar 2015 11:56:23 +0000 (14:56 +0300)
src/topten.c

index b68ad1bce46f82cf5198db1de5b5914e41974f7e..19eaa2ed2b5200870ca73e9c684a665f8039cb7f 100644 (file)
@@ -66,6 +66,7 @@ STATIC_DCL void FDECL(discardexcess, (FILE *));
 STATIC_DCL void FDECL(readentry, (FILE *,struct toptenentry *));
 STATIC_DCL void FDECL(writeentry, (FILE *,struct toptenentry *));
 STATIC_DCL void FDECL(writexlentry, (FILE*, struct toptenentry *));
+STATIC_DCL long NDECL(encodexlogflags);
 STATIC_DCL long NDECL(encodeconduct);
 STATIC_DCL long NDECL(encodeachieve);
 STATIC_DCL void FDECL(free_ttlist, (struct toptenentry *));
@@ -341,10 +342,23 @@ struct toptenentry *tt;
     Fprintf(rfile, "%cgender0=%s%calign0=%s",
            XLOG_SEP, genders[flags.initgend].filecode,
            XLOG_SEP, aligns[1 - u.ualignbase[A_ORIGINAL]].filecode);
+    Fprintf(rfile, "%cflags=0x%lx",
+           XLOG_SEP, encodexlogflags());
     Fprintf(rfile, "\n");
 #undef XLOG_SEP
 }
 
+STATIC_OVL long
+encodexlogflags()
+{
+    long e = 0L;
+
+    if (wizard)   e |= 1L << 0;
+    if (discover) e |= 1L << 1;
+
+    return e;
+}
+
 STATIC_OVL long
 encodeconduct()
 {