diff xrogue/util.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 d71e5e1f49cf
children
line wrap: on
line diff
--- a/xrogue/util.c	Sat Mar 20 22:36:52 2021 -0400
+++ b/xrogue/util.c	Wed Apr 14 18:55:33 2021 -0400
@@ -297,7 +297,7 @@
                             ret.y < 1 || ret.y > lines - 3)
                                 continue; /* off the screen? */
 
-                        ch = winat(ret.y, ret.x);
+                        ch = winat(ret.y, ret.x) & A_CHARTEXT;
 
                         /*
                          * Check to make certain the spot is valid
@@ -692,7 +692,7 @@
             if (y < 1 || y > lines - 3) continue;
 
             /* See what's there -- ignore monsters, just see what they're on */
-            savech = mvwinch(mw, y, x);
+            savech = mvwinch(mw, y, x) & A_CHARTEXT;
             waddch(mw, ' ');
             ch = show(y, x);
             mvwaddch(mw, y, x, savech); /* Restore monster */
@@ -750,7 +750,8 @@
                         mvwaddch(cw, y, x, in_room ? ' ' : PASSAGE);
 
                         /* If we found a monster, set it to darkness! */
-                        if (it) (THINGPTR(it))->t_oldch = mvwinch(cw, y, x);
+                        if (it) (THINGPTR(it))->t_oldch = mvwinch(cw, y, x) &
+                                    A_CHARTEXT;
                 }
                 
             /* Moving out of a corridor? */
@@ -794,7 +795,7 @@
 
                 if (it) {
                     tp = THINGPTR(it);
-                    tp->t_oldch = mvinch(y, x);
+                    tp->t_oldch = mvinch(y, x) & A_CHARTEXT;
                     if (isatrap(tp->t_oldch)) {
                         register struct trap *trp = trap_at(y, x);
 
@@ -818,7 +819,7 @@
              */
             if (off(player, ISBLIND))
             {
-                if (y == hero.y && x == hero.x
+                if ((y == hero.y && x == hero.x)
                     || (inpass && (ch == HORZWALL || ch == VERTWALL)))
                         continue;
 
@@ -1011,7 +1012,7 @@
     msg("Where do you wish to %s to? (* for help) ", action);
     c = get_coordinates();
     mpos = 0;
-    which = winat(c.y, c.x);
+    which = winat(c.y, c.x) & A_CHARTEXT;
     switch (which) {
         default:
             if (!isrock(which) || off(player, CANINWALL)) break;
@@ -1169,12 +1170,14 @@
     cp.y = y;
     cp.x = x;
     cpp = &cp;
-    for (rp = rooms, i = 0; i < MAXROOMS; rp++, i++)
-        if (inroom(rp, cpp))
+    for (rp = rooms, i = 0; i < MAXROOMS; rp++, i++) {
+        if (inroom(rp, cpp)) {
             if (y == rp->r_pos.y || y == rp->r_pos.y + rp->r_max.y - 1)
                 return(HORZWALL);
             else
                 return(VERTWALL);
+        }
+    }
 
     return('p');
 }