diff xrogue/actions.c @ 304:e52a8a7ad4c5

Fix many compiler warnings. There should only be two changes in behavior: arogue7/fight.c, arogue7/fight.c: a to-hit bonus is now correctly applied to characters who are not monks instead of monks who are not empty-handed. urogue/fight.c: fixed an interaction with the "debug" macro that could cause the wrong message to be displayed.
author John "Elwin" Edwards
date Wed, 14 Apr 2021 18:55:33 -0400
parents f54901b9c39b
children
line wrap: on
line diff
--- a/xrogue/actions.c	Sat Mar 20 22:36:52 2021 -0400
+++ b/xrogue/actions.c	Wed Apr 14 18:55:33 2021 -0400
@@ -435,8 +435,8 @@
      * of the room, the monster would already be on the best door out;
      * so he would never move.
      */
-    if ((sch = mvwinch(stdscr, th->t_pos.y, th->t_pos.x)) == DOOR ||
-        sch == SECRETDOOR || sch == PASSAGE) {
+    sch = mvwinch(stdscr, th->t_pos.y, th->t_pos.x) & A_CHARTEXT;
+    if (sch == DOOR || sch == SECRETDOOR || sch == PASSAGE) {
         rer = NULL;
     }
     this = *th->t_dest;
@@ -464,7 +464,8 @@
         char dch='\0';                          /* Door character */
 
         if ((th->t_doorgoal.x != -1) && (th->t_doorgoal.y != -1))
-            dch = mvwinch(stdscr, th->t_doorgoal.y, th->t_doorgoal.x);
+            dch = mvwinch(stdscr, th->t_doorgoal.y, th->t_doorgoal.x) & 
+                    A_CHARTEXT;
             
         /* Do we have a valid goal? */
         if ((dch == PASSAGE || dch == DOOR) &&  /* A real door */
@@ -488,7 +489,7 @@
             exitx = exit->x;
 
             /* Make sure it is a real door */
-            dch = mvwinch(stdscr, exity, exitx);
+            dch = mvwinch(stdscr, exity, exitx) & A_CHARTEXT;
             if (dch == PASSAGE || dch == DOOR) {
                 /* Don't count a door if we are fleeing from someone and
                  * he is standing on it.  Also, don't count it if he is