comparison 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
comparison
equal deleted inserted replaced
303:e06ebc407615 304:e52a8a7ad4c5
295 295
296 if (ret.x < 0 || ret.x > cols - 1 || 296 if (ret.x < 0 || ret.x > cols - 1 ||
297 ret.y < 1 || ret.y > lines - 3) 297 ret.y < 1 || ret.y > lines - 3)
298 continue; /* off the screen? */ 298 continue; /* off the screen? */
299 299
300 ch = winat(ret.y, ret.x); 300 ch = winat(ret.y, ret.x) & A_CHARTEXT;
301 301
302 /* 302 /*
303 * Check to make certain the spot is valid 303 * Check to make certain the spot is valid
304 */ 304 */
305 switch( ch ) { 305 switch( ch ) {
690 bool in_room; /* Are we in a room? */ 690 bool in_room; /* Are we in a room? */
691 691
692 if (y < 1 || y > lines - 3) continue; 692 if (y < 1 || y > lines - 3) continue;
693 693
694 /* See what's there -- ignore monsters, just see what they're on */ 694 /* See what's there -- ignore monsters, just see what they're on */
695 savech = mvwinch(mw, y, x); 695 savech = mvwinch(mw, y, x) & A_CHARTEXT;
696 waddch(mw, ' '); 696 waddch(mw, ' ');
697 ch = show(y, x); 697 ch = show(y, x);
698 mvwaddch(mw, y, x, savech); /* Restore monster */ 698 mvwaddch(mw, y, x, savech); /* Restore monster */
699 699
700 /* 700 /*
748 case FOREST: 748 case FOREST:
749 default: 749 default:
750 mvwaddch(cw, y, x, in_room ? ' ' : PASSAGE); 750 mvwaddch(cw, y, x, in_room ? ' ' : PASSAGE);
751 751
752 /* If we found a monster, set it to darkness! */ 752 /* If we found a monster, set it to darkness! */
753 if (it) (THINGPTR(it))->t_oldch = mvwinch(cw, y, x); 753 if (it) (THINGPTR(it))->t_oldch = mvwinch(cw, y, x) &
754 A_CHARTEXT;
754 } 755 }
755 756
756 /* Moving out of a corridor? */ 757 /* Moving out of a corridor? */
757 if (levtype == MAZELEV && !ce(hero, player.t_oldpos) && 758 if (levtype == MAZELEV && !ce(hero, player.t_oldpos) &&
758 !running && !isrock(ch) && /* Not running and not a wall */ 759 !running && !isrock(ch) && /* Not running and not a wall */
792 else 793 else
793 it = find_mons(y, x); 794 it = find_mons(y, x);
794 795
795 if (it) { 796 if (it) {
796 tp = THINGPTR(it); 797 tp = THINGPTR(it);
797 tp->t_oldch = mvinch(y, x); 798 tp->t_oldch = mvinch(y, x) & A_CHARTEXT;
798 if (isatrap(tp->t_oldch)) { 799 if (isatrap(tp->t_oldch)) {
799 register struct trap *trp = trap_at(y, x); 800 register struct trap *trp = trap_at(y, x);
800 801
801 tp->t_oldch = (trp->tr_flags & ISFOUND) ? tp->t_oldch 802 tp->t_oldch = (trp->tr_flags & ISFOUND) ? tp->t_oldch
802 : trp->tr_show; 803 : trp->tr_show;
816 * Don't show room walls if he is in a passage and 817 * Don't show room walls if he is in a passage and
817 * check for maze turns 818 * check for maze turns
818 */ 819 */
819 if (off(player, ISBLIND)) 820 if (off(player, ISBLIND))
820 { 821 {
821 if (y == hero.y && x == hero.x 822 if ((y == hero.y && x == hero.x)
822 || (inpass && (ch == HORZWALL || ch == VERTWALL))) 823 || (inpass && (ch == HORZWALL || ch == VERTWALL)))
823 continue; 824 continue;
824 825
825 /* Did we come to a crossroads in a maze? */ 826 /* Did we come to a crossroads in a maze? */
826 if (levtype == MAZELEV && 827 if (levtype == MAZELEV &&
1009 } 1010 }
1010 1011
1011 msg("Where do you wish to %s to? (* for help) ", action); 1012 msg("Where do you wish to %s to? (* for help) ", action);
1012 c = get_coordinates(); 1013 c = get_coordinates();
1013 mpos = 0; 1014 mpos = 0;
1014 which = winat(c.y, c.x); 1015 which = winat(c.y, c.x) & A_CHARTEXT;
1015 switch (which) { 1016 switch (which) {
1016 default: 1017 default:
1017 if (!isrock(which) || off(player, CANINWALL)) break; 1018 if (!isrock(which) || off(player, CANINWALL)) break;
1018 1019
1019 case FLOOR: 1020 case FLOOR:
1167 static coord cp; 1168 static coord cp;
1168 1169
1169 cp.y = y; 1170 cp.y = y;
1170 cp.x = x; 1171 cp.x = x;
1171 cpp = &cp; 1172 cpp = &cp;
1172 for (rp = rooms, i = 0; i < MAXROOMS; rp++, i++) 1173 for (rp = rooms, i = 0; i < MAXROOMS; rp++, i++) {
1173 if (inroom(rp, cpp)) 1174 if (inroom(rp, cpp)) {
1174 if (y == rp->r_pos.y || y == rp->r_pos.y + rp->r_max.y - 1) 1175 if (y == rp->r_pos.y || y == rp->r_pos.y + rp->r_max.y - 1)
1175 return(HORZWALL); 1176 return(HORZWALL);
1176 else 1177 else
1177 return(VERTWALL); 1178 return(VERTWALL);
1179 }
1180 }
1178 1181
1179 return('p'); 1182 return('p');
1180 } 1183 }
1181 1184
1182 /* 1185 /*