Fix one more batch of compiler warnings.

A few of these were potential bugs.
This commit is contained in:
John "Elwin" Edwards 2021-05-04 21:03:47 -04:00
parent 3dfd8fd09b
commit 06cad9ee1e
14 changed files with 30 additions and 27 deletions

View file

@ -594,12 +594,12 @@ wake_monster(int y, int x)
/*
* Every time he sees mean monster, it might start chasing him
*/
if (on(*tp, ISMEAN) &&
if ((on(*tp, ISMEAN) &&
off(*tp, ISHELD) &&
off(*tp, ISRUN) &&
rnd(100) > 33 &&
(!is_stealth(&player) || (on(*tp, ISUNIQUE) && rnd(100) > 50)) &&
(off(player, ISINVIS) || on(*tp, CANSEE)) ||
(off(player, ISINVIS) || on(*tp, CANSEE))) ||
(trp != NULL && (trp->r_flags & ISTREAS))) {
runto(tp, &hero);
}

View file

@ -132,7 +132,8 @@ be_trapped(struct thing *th, coord *tc)
/* Make sure we were not chasing a monster here */
th->t_dest = &hero;
if (on(*th, ISFRIENDLY), turn_off(*th, ISFLEE));
if (on(*th, ISFRIENDLY))
turn_off(*th, ISFLEE);
}
}
when BEARTRAP:
@ -406,7 +407,8 @@ be_trapped(struct thing *th, coord *tc)
/* Make sure we were not chasing a monster here */
th->t_dest = &hero;
if (on(*th, ISFRIENDLY), turn_off(*th, ISFLEE));
if (on(*th, ISFRIENDLY))
turn_off(*th, ISFLEE);
}
else
killed(mitem, FALSE, FALSE, FALSE);

View file

@ -1249,7 +1249,7 @@ void init_player(void);
void init_stones(void);
void init_terrain(void);
void init_things(void);
void init_weapon(struct object *weap, char type);
void init_weapon(struct object *weap, int type);
char *inv_name(struct object *obj, bool drop);
bool inventory(struct linked_list *list, int type);
bool is_current(struct object *obj);

View file

@ -197,7 +197,7 @@ hit_monster(int y, int x, struct object *obj, struct thing *tp)
*/
void
init_weapon(struct object *weap, char type)
init_weapon(struct object *weap, int type)
{
register struct init_weps *iwp;