]> granicus.if.org Git - nethack/commitdiff
Show level annotation on level entry
authorPasi Kallinen <paxed@alt.org>
Sun, 26 Apr 2015 07:46:38 +0000 (10:46 +0300)
committerPasi Kallinen <paxed@alt.org>
Sun, 26 Apr 2015 07:46:42 +0000 (10:46 +0300)
Idea by Chris Smith, via Unnethack

include/extern.h
src/do.c
src/dungeon.c

index 821f2a41cf889697fb5a6edde5a71ddc0ad1b262..4bf8dbbf31a1d66615701be97cabaa057278544a 100644 (file)
@@ -570,6 +570,7 @@ E boolean FDECL(Invocation_lev, (d_level *));
 E xchar NDECL(level_difficulty);
 E schar FDECL(lev_by_name, (const char *));
 E schar FDECL(print_dungeon, (BOOLEAN_P,schar *,xchar *));
+E char *FDECL(get_annotation, (d_level *));
 E int NDECL(donamelevel);
 E int NDECL(dooverview);
 E void FDECL(show_overview, (int,int));
index 97c11a8efbe718df8912cb535218c72b68155b06..3962e6d01e4336985a309e82c5f3b8a9993fa3c1 100644 (file)
--- a/src/do.c
+++ b/src/do.c
@@ -1069,6 +1069,7 @@ boolean at_stairs, falling, portal;
     boolean new = FALSE;       /* made a new level? */
     struct monst *mtmp;
     char whynot[BUFSZ];
+    char *annotation;
 
     if (dunlev(newlevel) > dunlevs_in_dungeon(newlevel))
         newlevel->dlevel = dunlevs_in_dungeon(newlevel);
@@ -1458,6 +1459,9 @@ boolean at_stairs, falling, portal;
     save_currentstate();
 #endif
 
+    if ((annotation = get_annotation(&u.uz)))
+       You("remember this level as %s.", annotation);
+
     /* assume this will always return TRUE when changing level */
     (void) in_out_region(u.ux, u.uy);
     (void) pickup(1);
index d02f3aec6096a5a59184b14579f602dfc619d99e..9a34aff0c154db8c37bb33e6a31301d8c52610f6 100644 (file)
@@ -1848,6 +1848,16 @@ d_level *dest;
     }
 }
 
+char *
+get_annotation(lev)
+d_level *lev;
+{
+    mapseen *mptr;
+    if ((mptr = find_mapseen(lev)))
+       return mptr->custom;
+    return NULL;
+}
+
 /* #annotate command - add a custom name to the current level */
 int
 donamelevel()