m_lined_up() type mismatch
m_lined_up() was declared 'boolean' but returned 0, 1, or 2. The 1 case isn't actually used any more. I changed it to 'int' rather than 2 to TRUE; it could just as easily be the other way 'round.
This commit is contained in:
+5
-4
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 mthrowu.c $NHDT-Date: 1581184742 2020/02/08 17:59:02 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.98 $ */
|
/* NetHack 3.6 mthrowu.c $NHDT-Date: 1586567393 2020/04/11 01:09:53 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.99 $ */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/*-Copyright (c) Pasi Kallinen, 2016. */
|
/*-Copyright (c) Pasi Kallinen, 2016. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
static int FDECL(monmulti, (struct monst *, struct obj *, struct obj *));
|
static int FDECL(monmulti, (struct monst *, struct obj *, struct obj *));
|
||||||
static void FDECL(monshoot, (struct monst *, struct obj *, struct obj *));
|
static void FDECL(monshoot, (struct monst *, struct obj *, struct obj *));
|
||||||
static int FDECL(drop_throw, (struct obj *, BOOLEAN_P, int, int));
|
static int FDECL(drop_throw, (struct obj *, BOOLEAN_P, int, int));
|
||||||
static boolean FDECL(m_lined_up, (struct monst *, struct monst *));
|
static int FDECL(m_lined_up, (struct monst *, struct monst *));
|
||||||
|
|
||||||
#define URETREATING(x, y) \
|
#define URETREATING(x, y) \
|
||||||
(distmin(u.ux, u.uy, x, y) > distmin(u.ux0, u.uy0, x, y))
|
(distmin(u.ux, u.uy, x, y) > distmin(u.ux0, u.uy0, x, y))
|
||||||
@@ -1014,7 +1014,7 @@ int boulderhandling; /* 0=block, 1=ignore, 2=conditionally block */
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static boolean
|
static int
|
||||||
m_lined_up(mtarg, mtmp)
|
m_lined_up(mtarg, mtmp)
|
||||||
struct monst *mtarg, *mtmp;
|
struct monst *mtarg, *mtmp;
|
||||||
{
|
{
|
||||||
@@ -1030,6 +1030,7 @@ struct monst *mtarg, *mtmp;
|
|||||||
&& U_AP_TYPE != M_AP_MONSTER)))
|
&& U_AP_TYPE != M_AP_MONSTER)))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
/* [no callers care about the 1 vs 2 situation any more] */
|
||||||
return linedup(tx, ty, mtmp->mx, mtmp->my,
|
return linedup(tx, ty, mtmp->mx, mtmp->my,
|
||||||
utarget ? (ignore_boulders ? 1 : 2) : 0);
|
utarget ? (ignore_boulders ? 1 : 2) : 0);
|
||||||
}
|
}
|
||||||
@@ -1040,7 +1041,7 @@ boolean
|
|||||||
lined_up(mtmp)
|
lined_up(mtmp)
|
||||||
register struct monst *mtmp;
|
register struct monst *mtmp;
|
||||||
{
|
{
|
||||||
return m_lined_up(&g.youmonst, mtmp);
|
return m_lined_up(&g.youmonst, mtmp) ? TRUE : FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check if a monster is carrying a particular item */
|
/* check if a monster is carrying a particular item */
|
||||||
|
|||||||
Reference in New Issue
Block a user