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.
This commit is contained in:
John "Elwin" Edwards 2021-04-14 18:55:33 -04:00
parent 6f21b5b88a
commit 6c3cd116ff
122 changed files with 374 additions and 280 deletions

View file

@ -62,7 +62,7 @@ can_blink(struct thing *tp)
/* 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 @@ can_blink(struct thing *tp)
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 @@ can_blink(struct thing *tp)
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 @@ chase(struct thing *tp, coord *ee, struct room *rer, struct room *ree,
* 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 @@ chase(struct thing *tp, coord *ee, struct room *rer, struct room *ree,
/* 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 @@ do_chase(struct thing *th)
}
}
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 @@ do_chase(struct thing *th)
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 @@ straight_shot(int ery, int erx, int eey, int eex, coord *shooting)
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: