diff xrogue/command.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 7c1cb43f346e
children 32bc72dcbf4f
line wrap: on
line diff
--- a/xrogue/command.c	Sat Mar 20 22:36:52 2021 -0400
+++ b/xrogue/command.c	Wed Apr 14 18:55:33 2021 -0400
@@ -111,7 +111,7 @@
                     /* If in a corridor or maze, if we are at a turn with
                      * only one way to go, turn that way.
                      */
-                    scratch = winat(hero.y, hero.x);
+                    scratch = winat(hero.y, hero.x) & A_CHARTEXT;
                     if ((scratch==PASSAGE||scratch==DOOR||levtype==MAZELEV)  &&
                         off(player, ISHUH)                                   && 
                         off(player, ISBLIND)) {
@@ -252,7 +252,7 @@
                         player.t_action = A_NIL;
                         if (add_pack((struct linked_list *)NULL, FALSE)) {
                             char tch;
-                            tch = mvwinch(stdscr, hero.y, hero.x);
+                            tch = mvwinch(stdscr, hero.y, hero.x) & A_CHARTEXT;
                             if (tch != FLOOR && tch != PASSAGE) {
                                 player.t_action = A_PICKUP; /*get more */
                                 player.t_no_move += 2 * movement(&player);
@@ -783,9 +783,9 @@
                 continue;
 
             /* Mch and ch will be the same unless there is a monster here */
-            mch = winat(y, x);
-            ch = mvwinch(stdscr, y, x);
-            sch = mvwinch(cw, y, x);    /* What's on the screen */
+            mch = winat(y, x) & A_CHARTEXT;
+            ch = mvwinch(stdscr, y, x) & A_CHARTEXT;
+            sch = mvwinch(cw, y, x) & A_CHARTEXT;    /* What's on the screen */
 
             if (door_chime == FALSE && isatrap(ch)) {
                     register struct trap *tp;
@@ -874,7 +874,7 @@
 d_level(void)
 {
     bool no_phase=FALSE;
-    char position = winat(hero.y, hero.x);
+    char position = winat(hero.y, hero.x) & A_CHARTEXT;
     int au;
 
 
@@ -977,7 +977,7 @@
 {
     bool no_phase = FALSE;
     register struct linked_list *item;
-    char position = winat(hero.y, hero.x);
+    char position = winat(hero.y, hero.x) & A_CHARTEXT;
     struct thing *tp;
     struct object *obj;
 
@@ -1166,7 +1166,7 @@
             }
             else know = (bool *) 0;
     }
-    if ((obj->o_flags & ISPOST) || (know && know[obj->o_which]) && !mark) {
+    if ((obj->o_flags & ISPOST) || (know && know[obj->o_which] && !mark)) {
         msg("That has already been identified.");
         return;
     }