diff xrogue/chase.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/chase.c	Sat Mar 20 22:36:52 2021 -0400
+++ b/xrogue/chase.c	Wed Apr 14 18:55:33 2021 -0400
@@ -62,7 +62,7 @@
 
             /* Is it OK to move there? */
             if (step_ok(y, x, NOMONST, tp) &&
-                (!isatrap(mvwinch(cw, y, x)) ||
+                (!isatrap(mvwinch(cw, y, x) & A_CHARTEXT) ||
                   rnd(10) >= tp->t_stats.s_intel ||
                   on(*tp, ISFLY))) {
                 /* OK, we can go here.  But don't go there if
@@ -92,7 +92,7 @@
         mvwaddch(cw, tp->t_pos.y, tp->t_pos.x, tp->t_oldch);
 
         /* Move it to the new space */
-        tp->t_oldch = mvwinch(cw, y, x);
+        tp->t_oldch = mvwinch(cw, y, x) & A_CHARTEXT;
 
         /* Display the creature if our hero can see it */
         if (cansee(y, x) &&
@@ -109,7 +109,7 @@
         tp->t_pos.x = x;
 
         /* If the monster is on a trap, trap it */
-        rch = mvinch(y, x);
+        rch = mvinch(y, x) & A_CHARTEXT;
         if (isatrap(rch)) {
             if (cansee(y, x)) tp->t_oldch = rch;
             be_trapped(tp, &(tp->t_pos));
@@ -253,7 +253,7 @@
                  * Don't look in our spot or where we were.
                  */
                 if (!ce(tryp, *er) && !ce(tryp, tp->t_oldpos) &&
-                    isalpha(mch = mvwinch(mw, y, x))) {
+                    isalpha(mch = mvwinch(mw, y, x) & A_CHARTEXT)) {
                     int test_dist;
 
                     test_dist = DISTANCE(y, x, ee->y, ee->x);
@@ -269,7 +269,7 @@
                 /* Can we move onto the spot? */        
                 if (!diag_ok(er, &tryp, tp)) continue;
 
-                ch = mvwinch(cw, y, x); /* Screen character */
+                ch = mvwinch(cw, y, x) & A_CHARTEXT; /* Screen character */
 
                 /*
                  * Stepping on player is NOT okay if we are fleeing.
@@ -703,13 +703,13 @@
         }
     }
 
-    rch = mvwinch(stdscr, old_pos.y, old_pos.x); 
+    rch = mvwinch(stdscr, old_pos.y, old_pos.x) & A_CHARTEXT;
     if (th->t_oldch == floor && rch != floor && !isatrap(rch))
         mvwaddch(cw, old_pos.y, old_pos.x, rch);
     else
         mvwaddch(cw, old_pos.y, old_pos.x, th->t_oldch);
-    sch = mvwinch(cw, ch_ret.y, ch_ret.x); /* What player sees */
-    rch = mvwinch(stdscr, ch_ret.y, ch_ret.x); /* What's really there */
+    sch = mvwinch(cw, ch_ret.y, ch_ret.x) & A_CHARTEXT; /* What player sees */
+    rch = mvwinch(stdscr, ch_ret.y, ch_ret.x) & A_CHARTEXT; /* What's really there */
 
     /* If we have a tunneling monster, it may be making a tunnel */
     if (on(*th, CANTUNNEL)      &&
@@ -799,7 +799,7 @@
     if (!ce(ch_ret, old_pos)) th->t_oldpos = old_pos;
 
     /* If the monster is on a trap, trap it */
-    sch = mvinch(ch_ret.y, ch_ret.x);
+    sch = mvinch(ch_ret.y, ch_ret.x) & A_CHARTEXT;
     if (isatrap(sch)) {
         if (cansee(ch_ret.y, ch_ret.x)) th->t_oldch = sch;
         be_trapped(th, &ch_ret);
@@ -907,7 +907,7 @@
     ery += dy;
     erx += dx;
     while ((ery != eey) || (erx != eex)) {
-        switch (ch = winat(ery, erx)) {
+        switch (ch = winat(ery, erx) & A_CHARTEXT) {
             case VERTWALL:
             case HORZWALL:
             case WALL: