]> granicus.if.org Git - nethack/commitdiff
better trap searching behavior
authorcohrs <cohrs>
Mon, 18 Mar 2002 07:30:48 +0000 (07:30 +0000)
committercohrs <cohrs>
Mon, 18 Mar 2002 07:30:48 +0000 (07:30 +0000)
- if a trap is hidden by clutter, cls() before delay, remove windowport
specific behavior, makes trap more obvious in all cases

src/detect.c

index 0490b04de78fc2a3f44d2815646eabcc6c15c475..60eda7083ea08f6bbb7f01918e591a7594f45b14 100644 (file)
@@ -1101,8 +1101,8 @@ find_trap(trap)
 struct trap *trap;
 {
     int tt = what_trap(trap->ttyp);
+    boolean cleared = FALSE;
 
-    You("find %s.", an(defsyms[trap_to_defsym(tt)].explanation));
     trap->tseen = 1;
     exercise(A_WIS, TRUE);
     if (Blind)
@@ -1112,24 +1112,17 @@ struct trap *trap;
 
     if (levl[trap->tx][trap->ty].glyph != trap_to_glyph(trap)) {
        /* There's too much clutter to see your find otherwise */
-       if (!strncmpi(windowprocs.name, "tty", 3)) {
-               tmp_at(DISP_ALWAYS, trap_to_glyph(trap));
-               tmp_at(trap->tx, trap->ty);
-               display_nhwindow(WIN_MAP, TRUE);        /* wait */
-               tmp_at(DISP_END,0);
-       }
-#if 0
-       /* This could flash the trap in a future post-3.4.0 release? (untested) */
-       else {
-               int i, tglyph = levl[trap->tx][trap->ty].glyph;
-               for (i = 0; i < 4; i++) {
-                       tmp_at(DISP_FLASH, trap_to_glyph(trap));
-                       tmp_at(trap->tx, trap->ty);
-                       delay_output();
-                       tmp_at(DISP_END, 0);
-               }
-       }
-#endif
+       cls();
+       map_trap(trap, 1);
+       display_self();
+       cleared = TRUE;
+    }
+
+    You("find %s.", an(defsyms[trap_to_defsym(tt)].explanation));
+
+    if (cleared) {
+       display_nhwindow(WIN_MAP, TRUE);        /* wait */
+       docrt();
     }
 }