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

@ -435,8 +435,8 @@ m_select(struct thing *th, bool flee)
* of the room, the monster would already be on the best door out;
* so he would never move.
*/
if ((sch = mvwinch(stdscr, th->t_pos.y, th->t_pos.x)) == DOOR ||
sch == SECRETDOOR || sch == PASSAGE) {
sch = mvwinch(stdscr, th->t_pos.y, th->t_pos.x) & A_CHARTEXT;
if (sch == DOOR || sch == SECRETDOOR || sch == PASSAGE) {
rer = NULL;
}
this = *th->t_dest;
@ -464,7 +464,8 @@ m_select(struct thing *th, bool flee)
char dch='\0'; /* Door character */
if ((th->t_doorgoal.x != -1) && (th->t_doorgoal.y != -1))
dch = mvwinch(stdscr, th->t_doorgoal.y, th->t_doorgoal.x);
dch = mvwinch(stdscr, th->t_doorgoal.y, th->t_doorgoal.x) &
A_CHARTEXT;
/* Do we have a valid goal? */
if ((dch == PASSAGE || dch == DOOR) && /* A real door */
@ -488,7 +489,7 @@ m_select(struct thing *th, bool flee)
exitx = exit->x;
/* Make sure it is a real door */
dch = mvwinch(stdscr, exity, exitx);
dch = mvwinch(stdscr, exity, exitx) & A_CHARTEXT;
if (dch == PASSAGE || dch == DOOR) {
/* Don't count a door if we are fleeing from someone and
* he is standing on it. Also, don't count it if he is

View file

@ -53,9 +53,9 @@ shoot_bolt(struct thing *shooter, coord start, coord dir, bool get_points,
bounces = 0; /* No bounces yet */
nofont(cw);
for (y = 0; y < BOLT_LENGTH && !used; y++) {
ch = winat(pos.y, pos.x);
ch = winat(pos.y, pos.x) & A_CHARTEXT;
spotpos[y].place = pos;
spotpos[y].oldch = mvwinch(cw, pos.y, pos.x);
spotpos[y].oldch = mvwinch(cw, pos.y, pos.x) & A_CHARTEXT;
/* Are we at hero? */
if (ce(pos, hero)) goto at_hero;
@ -70,8 +70,8 @@ shoot_bolt(struct thing *shooter, coord start, coord dir, bool get_points,
dir.x = -dir.x;
}
else {
unsigned char chx = mvinch(pos.y-dir.y, pos.x),
chy = mvinch(pos.y, pos.x-dir.x);
unsigned char chx = mvinch(pos.y-dir.y, pos.x) & A_CHARTEXT,
chy = mvinch(pos.y, pos.x-dir.x) & A_CHARTEXT;
bool anychange = FALSE; /* Did we change anthing */
if (chy == WALL || chy == SECRETDOOR ||

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:

View file

@ -111,7 +111,7 @@ command(void)
/* 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 @@ command(void)
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 @@ search(bool is_thief, bool door_chime)
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 @@ void
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 @@ u_level(void)
{
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 @@ nameitem(struct linked_list *item, bool mark)
}
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;
}

View file

@ -166,7 +166,7 @@ wghtchk(void)
inwhgt = TRUE;
if (pstats.s_pack > pstats.s_carry) {
ch = mvwinch(stdscr, hero.y, hero.x);
ch = mvwinch(stdscr, hero.y, hero.x) & A_CHARTEXT;
if((ch != FLOOR && ch != PASSAGE)) {
extinguish(wghtchk);
fuse(wghtchk, NULL, 1, AFTER);

View file

@ -541,9 +541,11 @@ roll_em(struct thing *att_er, struct thing *def_er, struct object *weap,
}
else if (att == &pstats) { /* Player attacks monster */
def_arm = def->s_arm - dext_prot(def->s_dext);
if (player.t_ctype == C_MONK) /* no strength bonus for monk */
if (player.t_ctype == C_MONK) {
/* no strength bonus for monk */
if (weap == NULL)
hplus += att->s_lvl/5; /* monks hplus varies with level */
}
else
hplus += str_plus(str_compute())+dext_plus(dex_compute());
}

View file

@ -167,8 +167,8 @@ step_ok(int y, int x, int can_on_monst, struct thing *flgptr)
unsigned char ch;
/* What is here? Don't check monster window if MONSTOK is set */
if (can_on_monst == MONSTOK) ch = mvinch(y, x);
else ch = winat(y, x);
if (can_on_monst == MONSTOK) ch = mvinch(y, x) & A_CHARTEXT;
else ch = winat(y, x) & A_CHARTEXT;
if (can_on_monst == FIGHTOK && isalpha(ch) &&
(item = find_mons(y, x)) != NULL) {

View file

@ -36,7 +36,6 @@ int
main(int argc, char *argv[], char *envp[])
{
register char *env;
time_t now;
md_init();
@ -232,8 +231,7 @@ main(int argc, char *argv[], char *envp[])
draw(cw);
/* A super wizard doesn't have to get equipped */
/* Check if "" option is TRUE and get environment flag */
if (wizard && strcmp(getenv("SUPER"),"YES") == 0 ||
def_attr == TRUE) {
if ((wizard && strcmp(getenv("SUPER"),"YES") == 0) || def_attr == TRUE) {
level = 1;
new_level(NORMLEV);
}

View file

@ -233,7 +233,7 @@ new_monster(struct linked_list *item, short type, coord *cp, bool max_monster)
tp->t_dest = NULL;
tp->t_name = NULL;
tp->t_pos = tp->t_oldpos = *cp;
tp->t_oldch = mvwinch(cw, cp->y, cp->x);
tp->t_oldch = mvwinch(cw, cp->y, cp->x) & A_CHARTEXT;
mvwaddch(mw, cp->y, cp->x, tp->t_type);
mp = &monsters[tp->t_index];

View file

@ -319,7 +319,7 @@ be_trapped(struct thing *th, coord *tc)
/* Put it there */
mvwaddch(mw, th->t_pos.y, th->t_pos.x, th->t_type);
th->t_oldch = mvwinch(cw, th->t_pos.y, th->t_pos.x);
th->t_oldch = mvwinch(cw, th->t_pos.y, th->t_pos.x) & A_CHARTEXT;
/*
* check to see if room that creature appears in should
* light up
@ -885,7 +885,7 @@ do_move(int dy, int dx)
}
if (running && ce(hero, move_nh))
after = running = FALSE;
ch = winat(move_nh.y, move_nh.x);
ch = winat(move_nh.y, move_nh.x) & A_CHARTEXT;
/* Take care of hero trying to move close to something frightening */
if (on(player, ISFLEE)) {
@ -969,7 +969,7 @@ do_move(int dy, int dx)
/* Did we succeed? */
if (ce(tp->t_pos, current)) {
/* Reset our idea of what ch is */
ch = winat(move_nh.y, move_nh.x);
ch = winat(move_nh.y, move_nh.x) & A_CHARTEXT;
/* Let it be known that we made the switch */
changed = TRUE;
@ -1140,22 +1140,22 @@ do_move(int dy, int dx)
case 'h':
case 'l':
if (old_hero.y + 1 < lines - 2) {
wall_check = winat(old_hero.y + 1, old_hero.x);
wall_check = winat(old_hero.y + 1, old_hero.x) & A_CHARTEXT;
if (!isrock(wall_check)) call_light = TRUE;
}
if (old_hero.y - 1 > 0) {
wall_check = winat(old_hero.y - 1, old_hero.x);
wall_check = winat(old_hero.y - 1, old_hero.x) & A_CHARTEXT;
if (!isrock(wall_check)) call_light = TRUE;
}
break;
case 'j':
case 'k':
if (old_hero.x + 1 < cols) {
wall_check = winat(old_hero.y, old_hero.x + 1);
wall_check = winat(old_hero.y, old_hero.x + 1) & A_CHARTEXT;
if (!isrock(wall_check)) call_light = TRUE;
}
if (old_hero.x - 1 >= 0) {
wall_check = winat(old_hero.y, old_hero.x - 1);
wall_check = winat(old_hero.y, old_hero.x - 1) & A_CHARTEXT;
if (!isrock(wall_check)) call_light = TRUE;
}
break;
@ -1177,7 +1177,7 @@ do_move(int dy, int dx)
if (rp->r_flags & ISTREAS)
wake_room(rp);
}
ch = winat(old_hero.y, old_hero.x);
ch = winat(old_hero.y, old_hero.x) & A_CHARTEXT;
wmove(cw, unc(old_hero));
waddch(cw, ch);
wmove(cw, unc(hero));
@ -1272,9 +1272,9 @@ light(coord *cp)
/* If we are looking at the hero in a rock, broaden our sights */
if (&hero == cp || &player.t_oldpos == cp) {
ch = winat(hero.y, hero.x);
ch = winat(hero.y, hero.x) & A_CHARTEXT;
if (isrock(ch)) see_radius = 2;
ch = winat(player.t_oldpos.y, player.t_oldpos.x);
ch = winat(player.t_oldpos.y, player.t_oldpos.x) & A_CHARTEXT;
if (isrock(ch)) see_radius = 2;
}
@ -1347,7 +1347,7 @@ light(coord *cp)
/* Previously not seen -- now can see it */
if (tp->t_oldch == ' ' && cansee(tp->t_pos.y, tp->t_pos.x))
tp->t_oldch = mvinch(y, x);
tp->t_oldch = mvinch(y, x) & A_CHARTEXT;
/* Previously seen -- now can't see it */
else if (!cansee(tp->t_pos.y, tp->t_pos.x) &&
@ -1379,8 +1379,8 @@ light(coord *cp)
on(player, ISBLIND) ||
(rp->r_flags & FORCEDARK) ||
(levtype == MAZELEV && !see_here && see_before)) {
sch = mvwinch(cw, y, x); /* What's seen */
rch = mvinch(y, x); /* What's really there */
sch = mvwinch(cw, y, x) & A_CHARTEXT; /* What's seen */
rch = mvinch(y, x) & A_CHARTEXT; /* What's really there */
switch (rch) {
case DOOR:
case SECRETDOOR:
@ -1598,7 +1598,7 @@ set_trap(struct thing *tp, int y, int x)
return;
}
can_traps:
switch (och = mvinch(y, x)) {
switch (och = mvinch(y, x) & A_CHARTEXT) {
case WALL:
case FLOOR:
case PASSAGE:
@ -1775,7 +1775,7 @@ set_trap(struct thing *tp, int y, int x)
char
show(int y, int x)
{
register unsigned char ch = winat(y, x);
register unsigned char ch = winat(y, x) & A_CHARTEXT;
register struct linked_list *it;
register struct thing *tp;
@ -1787,7 +1787,7 @@ show(int y, int x)
else if (isalpha(ch)) {
if ((it = find_mons(y, x)) == NULL) {
msg("Show: Can't find monster in show (%d, %d)", y, x);
return(mvwinch(stdscr, y, x));
return(mvwinch(stdscr, y, x) & A_CHARTEXT);
}
tp = THINGPTR(it);
@ -1797,7 +1797,7 @@ show(int y, int x)
else if (invisible(tp)) {
/* We can't see surprise-type creatures through "see invisible" */
if (off(player,CANSEE) || on(*tp,CANSURPRISE))
ch = mvwinch(stdscr, y, x); /* Invisible */
ch = mvwinch(stdscr, y, x) & A_CHARTEXT; /* Invisible */
}
else if (on(*tp, CANINWALL)) {
if (isrock(mvwinch(stdscr, y, x))) ch = winch(stdscr); /* As Xorn */

View file

@ -100,22 +100,22 @@ new_level(LEVTYPE ltype)
if (vert)
for (j=1; j<cols-1; j++) {
if (top) {
cch = mvinch(i+2, j);
cch = mvinch(i+2, j) & A_CHARTEXT;
mvaddch(lines-6+i, j, cch);
}
else {
cch = mvinch(lines-4-i, j);
cch = mvinch(lines-4-i, j) & A_CHARTEXT;
mvaddch(4-i, j, cch);
}
}
else
for (j=2; j<lines-3; j++) {
if (top) {
cch = mvinch(j, i+1);
cch = mvinch(j, i+1) & A_CHARTEXT;
mvaddch(j, cols-4+i, cch);
}
else {
cch = mvinch(j, cols-2-i);
cch = mvinch(j, cols-2-i) & A_CHARTEXT;
mvaddch(j, 3-i, cch);
}
}
@ -310,7 +310,7 @@ new_level(LEVTYPE ltype)
rnd_pos(&rooms[rm], &tp->t_pos);
} until (cnt++ > 2500 || winat(tp->t_pos.y, tp->t_pos.x) == FLOOR);
mvwaddch(mw, tp->t_pos.y, tp->t_pos.x, tp->t_type);
tp->t_oldch = mvwinch(cw, tp->t_pos.y, tp->t_pos.x);
tp->t_oldch = mvwinch(cw, tp->t_pos.y, tp->t_pos.x) & A_CHARTEXT;
/*
* If it has a fire, mark it
@ -335,7 +335,7 @@ new_level(LEVTYPE ltype)
nitem = next(item);
tp = THINGPTR(item);
mvwaddch(mw, tp->t_pos.y, tp->t_pos.x, tp->t_type);
tp->t_oldch = mvwinch(cw, tp->t_pos.y, tp->t_pos.x);
tp->t_oldch = mvwinch(cw, tp->t_pos.y, tp->t_pos.x) & A_CHARTEXT;
/*
* If it has a fire, mark it

View file

@ -259,6 +259,7 @@ get_str(char *opt, WINDOW *win)
continue;
}
else if (sp == buf)
{
if (c == '-' && win == hw) /* To move back a line in hw */
break;
else if (c == '~')
@ -268,6 +269,7 @@ get_str(char *opt, WINDOW *win)
sp += strlen(home);
continue;
}
}
*sp++ = c;
waddstr(win, unctrl(c));
}
@ -320,6 +322,7 @@ option(void)
retval = (*op->o_getfunc)(op->o_opt, hw);
if (retval)
{
if (retval == QUIT)
break;
else if (op > optlist) { /* MINUS */
@ -332,6 +335,7 @@ option(void)
wmove(hw, 0, 0);
op--;
}
}
}
/*
* Switch back to original screen

View file

@ -68,7 +68,7 @@ do_terrain(int basey, int basex, int deltay, int deltax, bool fresh)
ch = rnd_terrain();
addch(ch);
}
else ch = mvinch(basey, basex);
else ch = mvinch(basey, basex) & A_CHARTEXT;
curx += deltax;
@ -95,10 +95,10 @@ do_terrain(int basey, int basex, int deltay, int deltax, bool fresh)
left_pos = curx - deltax;
top_pos = cury - deltay;
left = mvinch(cury, left_pos);
top_left = mvinch(top_pos, left_pos);
top = mvinch(top_pos, curx);
top_right = mvinch(top_pos, curx + deltax);
left = mvinch(cury, left_pos) & A_CHARTEXT;
top_left = mvinch(top_pos, left_pos) & A_CHARTEXT;
top = mvinch(top_pos, curx) & A_CHARTEXT;
top_right = mvinch(top_pos, curx + deltax) & A_CHARTEXT;
/* Put the piece of terrain on the map */
mvaddch(cury, curx, get_terrain(left, top_left, top, top_right));

View file

@ -142,7 +142,7 @@ void
conn(int r1, int r2)
{
register struct room *rpf, *rpt = NULL;
register char rmt;
register signed char rmt;
register int distance = 0, max_diag, offset = 0, i;
register int rm;
int turns[3], turn_dist[3];

View file

@ -504,7 +504,7 @@ score(unsigned long amount, int flags, short monst)
/* Make sure we have an in-bound reason */
if (scp->sc_flags > REASONLEN) scp->sc_flags = REASONLEN;
printf("%3d %10lu\t%s (%s)", scp - top_ten + 1,
printf("%3d %10lu\t%s (%s)", (int) (scp - top_ten + 1),
scp->sc_score, scp->sc_name, class);
if (prflags == REALLIFE) printf(" [in real life %.*s!%.*s]",

View file

@ -341,7 +341,7 @@ read_scroll(int which, int flag, bool is_scroll)
for (i = 1; i < lines-2; i++)
for (j = 0; j < cols; j++)
{
switch (nch = ch = mvwinch(hw, i, j))
switch (nch = ch = mvwinch(hw, i, j) & A_CHARTEXT)
{
case SECRETDOOR:
nch = secretdoor (i, j);

View file

@ -3259,8 +3259,8 @@ md_gethomedir(void)
h = szPath;
#endif
if ( (h == NULL) || (*h == '\0') )
if ( (h = getenv("HOME")) == NULL )
if ( (h == NULL) || (*h == '\0') ) {
if ( (h = getenv("HOME")) == NULL ) {
if ( (h = getenv("HOMEDRIVE")) == NULL)
h = "";
else
@ -3271,6 +3271,8 @@ md_gethomedir(void)
if ( (h = getenv("HOMEPATH")) == NULL)
h = "";
}
}
}
len = strlen(homedir);
@ -3409,7 +3411,7 @@ md_shellescape(void)
*/
setuid(getuid());
setgid(getgid());
execl(sh == NULL ? "/bin/sh" : sh, "shell", "-i", 0);
execl(sh == NULL ? "/bin/sh" : sh, "shell", "-i", (char *) NULL);
perror("No shelly");
_exit(-1);
}

View file

@ -269,7 +269,7 @@ do_zap(struct thing *zapper, struct object *obj, coord *direction, int which,
mvwaddch(mw, y, x, ' ');
mvwaddch(mw, tp->t_pos.y, tp->t_pos.x, tp->t_type);
if (tp->t_pos.y != y || tp->t_pos.x != x)
tp->t_oldch = mvwinch(cw, tp->t_pos.y, tp->t_pos.x);
tp->t_oldch = mvwinch(cw, tp->t_pos.y, tp->t_pos.x) & A_CHARTEXT;
/*
* check to see if room that creature appears in should
* light up
@ -341,7 +341,7 @@ do_zap(struct thing *zapper, struct object *obj, coord *direction, int which,
direction->y += hero.y;
direction->x += hero.x;
ch = winat(direction->y, direction->x);
ch = winat(direction->y, direction->x) & A_CHARTEXT;
if (isalpha(ch))
{
strike = *obj;
@ -550,7 +550,7 @@ do_zap(struct thing *zapper, struct object *obj, coord *direction, int which,
for(m2=tp->t_pos.y-1 ; m2<=tp->t_pos.y+1 ; m2++) {
if (m1 == hero.x && m2 == hero.y)
continue;
ch = winat(m2,m1);
ch = winat(m2,m1) & A_CHARTEXT;
if (shoot_ok(ch)) {
mp.x = m1; /* create it */
mp.y = m2;

View file

@ -395,7 +395,7 @@ drop(struct linked_list *item)
}
}
switch(ch = mvwinch(stdscr, hero.y, hero.x)) {
switch(ch = mvwinch(stdscr, hero.y, hero.x) & A_CHARTEXT) {
case PASSAGE:
case SCROLL:
case POTION:

View file

@ -297,7 +297,7 @@ fallpos(coord *pos, bool be_clear, int range)
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 @@ look(bool wakeup, bool runend)
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 @@ look(bool wakeup, bool runend)
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 @@ look(bool wakeup, bool runend)
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 @@ look(bool wakeup, bool runend)
*/
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 @@ move_hero(int why)
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 @@ secretdoor(int y, int x)
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');
}

View file

@ -598,7 +598,7 @@ xcrypt(key, setting)
if ((*q++ = *key << 1))
key++;
}
if (des_setkey((unsigned char *) keybuf))
if (des_setkey((char *) keybuf))
return(NULL);
if (*setting == _PASSWORD_EFMT1) {
@ -617,7 +617,7 @@ xcrypt(key, setting)
/*
* Encrypt the key with itself.
*/
if (des_cipher((unsigned char*)keybuf, (unsigned char*)keybuf, 0, 1))
if (des_cipher((char*)keybuf, (char*)keybuf, 0, 1))
return(NULL);
/*
* And XOR with the next 8 characters of the key.
@ -627,7 +627,7 @@ xcrypt(key, setting)
*key)
*q++ ^= *key++ << 1;
if (des_setkey((unsigned char *) keybuf))
if (des_setkey((char *) keybuf))
return(NULL);
}
strncpy((char *)output, setting, 9);