Make BARGETHROUGH unconditional.

This commit is contained in:
Sean Hunt
2015-02-27 19:06:01 -05:00
parent 6e9fa71b05
commit b138d380ea
10 changed files with 0 additions and 61 deletions

View File

@@ -425,7 +425,6 @@ typedef unsigned char uchar;
# endif # endif
#endif #endif
#define AUTOPICKUP_EXCEPTIONS /* exceptions to autopickup */ #define AUTOPICKUP_EXCEPTIONS /* exceptions to autopickup */
#define BARGETHROUGH /* allow some monsters to move others out of their way */
#ifdef REDO #ifdef REDO
# define DOAGAIN '\001' /* ^A, the "redo" key used in cmd.c and getline.c */ # define DOAGAIN '\001' /* ^A, the "redo" key used in cmd.c and getline.c */

View File

@@ -520,9 +520,7 @@ E void FDECL(clear_symsetentry, (int,BOOLEAN_P));
E void FDECL(update_l_symset, (struct symparse *,int)); E void FDECL(update_l_symset, (struct symparse *,int));
E void FDECL(update_r_symset, (struct symparse *,int)); E void FDECL(update_r_symset, (struct symparse *,int));
#endif #endif
#ifdef BARGETHROUGH
E boolean FDECL(cursed_object_at, (int, int)); E boolean FDECL(cursed_object_at, (int, int));
#endif
/* ### dungeon.c ### */ /* ### dungeon.c ### */
@@ -1090,9 +1088,7 @@ E int FDECL(buzzmu, (struct monst *,struct attack *));
E int FDECL(fightm, (struct monst *)); E int FDECL(fightm, (struct monst *));
E int FDECL(mattackm, (struct monst *,struct monst *)); E int FDECL(mattackm, (struct monst *,struct monst *));
E boolean FDECL(engulf_target, (struct monst *,struct monst *)); E boolean FDECL(engulf_target, (struct monst *,struct monst *));
#ifdef BARGETHROUGH
E int FDECL(mdisplacem, (struct monst *,struct monst *,BOOLEAN_P)); E int FDECL(mdisplacem, (struct monst *,struct monst *,BOOLEAN_P));
#endif
E void FDECL(paralyze_monst, (struct monst *,int)); E void FDECL(paralyze_monst, (struct monst *,int));
E int FDECL(sleep_monst, (struct monst *,int,int)); E int FDECL(sleep_monst, (struct monst *,int,int));
E void FDECL(slept_monst, (struct monst *)); E void FDECL(slept_monst, (struct monst *));
@@ -1374,11 +1370,9 @@ E boolean FDECL(accessible, (int,int));
E void FDECL(set_apparxy, (struct monst *)); E void FDECL(set_apparxy, (struct monst *));
E boolean FDECL(can_ooze, (struct monst *)); E boolean FDECL(can_ooze, (struct monst *));
E boolean FDECL(can_fog, (struct monst *)); E boolean FDECL(can_fog, (struct monst *));
#ifdef BARGETHROUGH
E boolean FDECL(should_displace, (struct monst *,coord *,long *,int, E boolean FDECL(should_displace, (struct monst *,coord *,long *,int,
XCHAR_P,XCHAR_P)); XCHAR_P,XCHAR_P));
E boolean FDECL(undesirable_disp, (struct monst *,XCHAR_P,XCHAR_P)); E boolean FDECL(undesirable_disp, (struct monst *,XCHAR_P,XCHAR_P));
#endif
/* ### monst.c ### */ /* ### monst.c ### */

View File

@@ -7,9 +7,7 @@
#ifndef MFNDPOS_H #ifndef MFNDPOS_H
#define MFNDPOS_H #define MFNDPOS_H
#ifdef BARGETHROUGH
#define ALLOW_MDISP 0x00001000L /* can displace a monster out of its way */ #define ALLOW_MDISP 0x00001000L /* can displace a monster out of its way */
#endif
#define ALLOW_TRAPS 0x00020000L /* can enter traps */ #define ALLOW_TRAPS 0x00020000L /* can enter traps */
#define ALLOW_U 0x00040000L /* can attack you */ #define ALLOW_U 0x00040000L /* can attack you */
#define ALLOW_M 0x00080000L /* can attack other monsters */ #define ALLOW_M 0x00080000L /* can attack other monsters */

View File

@@ -131,9 +131,7 @@
#define is_covetous(ptr) ((ptr->mflags3 & M3_COVETOUS)) #define is_covetous(ptr) ((ptr->mflags3 & M3_COVETOUS))
#define infravision(ptr) ((ptr->mflags3 & M3_INFRAVISION)) #define infravision(ptr) ((ptr->mflags3 & M3_INFRAVISION))
#define infravisible(ptr) ((ptr->mflags3 & M3_INFRAVISIBLE)) #define infravisible(ptr) ((ptr->mflags3 & M3_INFRAVISIBLE))
#ifdef BARGETHROUGH
#define is_displacer(ptr) (((ptr)->mflags3 & M3_DISPLACES) != 0L) #define is_displacer(ptr) (((ptr)->mflags3 & M3_DISPLACES) != 0L)
#endif
#define is_mplayer(ptr) (((ptr) >= &mons[PM_ARCHEOLOGIST]) && \ #define is_mplayer(ptr) (((ptr) >= &mons[PM_ARCHEOLOGIST]) && \
((ptr) <= &mons[PM_WIZARD])) ((ptr) <= &mons[PM_WIZARD]))
#define is_rider(ptr) ((ptr) == &mons[PM_DEATH] || \ #define is_rider(ptr) ((ptr) == &mons[PM_DEATH] || \

View File

@@ -161,7 +161,6 @@
#define M3_INFRAVISION 0x0100 /* has infravision */ #define M3_INFRAVISION 0x0100 /* has infravision */
#define M3_INFRAVISIBLE 0x0200 /* visible by infravision */ #define M3_INFRAVISIBLE 0x0200 /* visible by infravision */
/* define the bit even if BARGETHROUGH is not defined for savefile compat. */
#define M3_DISPLACES 0x0400 /* moves monsters out of its way */ #define M3_DISPLACES 0x0400 /* moves monsters out of its way */
#define MZ_TINY 0 /* < 2' */ #define MZ_TINY 0 /* < 2' */

View File

@@ -109,19 +109,11 @@ struct monst *mon;
static NEARDATA const char nofetch[] = { BALL_CLASS, CHAIN_CLASS, ROCK_CLASS, 0 }; static NEARDATA const char nofetch[] = { BALL_CLASS, CHAIN_CLASS, ROCK_CLASS, 0 };
#ifndef BARGETHROUGH
STATIC_OVL boolean FDECL(cursed_object_at, (int, int));
#endif /* not BARGETHROUGH */
STATIC_VAR xchar gtyp, gx, gy; /* type and position of dog's current goal */ STATIC_VAR xchar gtyp, gx, gy; /* type and position of dog's current goal */
STATIC_PTR void FDECL(wantdoor, (int, int, genericptr_t)); STATIC_PTR void FDECL(wantdoor, (int, int, genericptr_t));
#ifdef BARGETHROUGH
boolean boolean
#else
STATIC_OVL boolean
#endif
cursed_object_at(x, y) cursed_object_at(x, y)
int x, y; int x, y;
{ {
@@ -584,9 +576,7 @@ register int after; /* this is extra fast monster movement */
struct obj *obj = (struct obj *) 0; struct obj *obj = (struct obj *) 0;
xchar otyp; xchar otyp;
boolean has_edog, cursemsg[9], do_eat = FALSE; boolean has_edog, cursemsg[9], do_eat = FALSE;
#ifdef BARGETHROUGH
boolean better_with_displacing = FALSE; boolean better_with_displacing = FALSE;
#endif
xchar nix, niy; /* position mtmp is (considering) moving to */ xchar nix, niy; /* position mtmp is (considering) moving to */
register int nx, ny; /* temporary coordinates */ register int nx, ny; /* temporary coordinates */
xchar cnt, uncursedcnt, chcnt; xchar cnt, uncursedcnt, chcnt;
@@ -642,9 +632,7 @@ register int after; /* this is extra fast monster movement */
if (passes_walls(mtmp->data)) allowflags |= (ALLOW_ROCK | ALLOW_WALL); if (passes_walls(mtmp->data)) allowflags |= (ALLOW_ROCK | ALLOW_WALL);
if (passes_bars(mtmp->data)) allowflags |= ALLOW_BARS; if (passes_bars(mtmp->data)) allowflags |= ALLOW_BARS;
if (throws_rocks(mtmp->data)) allowflags |= ALLOW_ROCK; if (throws_rocks(mtmp->data)) allowflags |= ALLOW_ROCK;
#ifdef BARGETHROUGH
if (is_displacer(mtmp->data)) allowflags |= ALLOW_MDISP; if (is_displacer(mtmp->data)) allowflags |= ALLOW_MDISP;
#endif
if (Conflict && !resist(mtmp, RING_CLASS, 0, 0)) { if (Conflict && !resist(mtmp, RING_CLASS, 0, 0)) {
allowflags |= ALLOW_U; allowflags |= ALLOW_U;
if (!has_edog) { if (!has_edog) {
@@ -681,19 +669,13 @@ register int after; /* this is extra fast monster movement */
uncursedcnt = 0; uncursedcnt = 0;
for (i = 0; i < cnt; i++) { for (i = 0; i < cnt; i++) {
nx = poss[i].x; ny = poss[i].y; nx = poss[i].x; ny = poss[i].y;
#ifdef BARGETHROUGH
if (MON_AT(nx,ny) && !((info[i] & ALLOW_M) || info[i] & ALLOW_MDISP)) if (MON_AT(nx,ny) && !((info[i] & ALLOW_M) || info[i] & ALLOW_MDISP))
continue; continue;
#else
if (MON_AT(nx,ny) && !(info[i] & ALLOW_M)) continue;
#endif
if (cursed_object_at(nx, ny)) continue; if (cursed_object_at(nx, ny)) continue;
uncursedcnt++; uncursedcnt++;
} }
#ifdef BARGETHROUGH
better_with_displacing = should_displace(mtmp,poss,info,cnt,gx,gy); better_with_displacing = should_displace(mtmp,poss,info,cnt,gx,gy);
#endif
chcnt = 0; chcnt = 0;
chi = -1; chi = -1;
@@ -747,7 +729,6 @@ register int after; /* this is extra fast monster movement */
} }
return 0; return 0;
} }
#ifdef BARGETHROUGH
if ((info[i] & ALLOW_MDISP) && MON_AT(nx, ny) && if ((info[i] & ALLOW_MDISP) && MON_AT(nx, ny) &&
better_with_displacing && better_with_displacing &&
!undesirable_disp(mtmp,nx,ny)) { !undesirable_disp(mtmp,nx,ny)) {
@@ -757,7 +738,6 @@ register int after; /* this is extra fast monster movement */
if (mstatus & MM_DEF_DIED) return 2; if (mstatus & MM_DEF_DIED) return 2;
return 0; return 0;
} }
#endif /* BARGETHROUGH */
{ /* Dog avoids harmful traps, but perhaps it has to pass one { /* Dog avoids harmful traps, but perhaps it has to pass one
* in order to follow player. (Non-harmful traps do not * in order to follow player. (Non-harmful traps do not

View File

@@ -168,7 +168,6 @@ fightm(mtmp) /* have monsters fight each other */
return 0; return 0;
} }
#ifdef BARGETHROUGH
/* /*
* mdisplacem() -- attacker moves defender out of the way; * mdisplacem() -- attacker moves defender out of the way;
* returns same results as mattackm(). * returns same results as mattackm().
@@ -244,7 +243,6 @@ boolean quietly;
return MM_HIT; return MM_HIT;
} }
#endif /* BARGETHROUGH */
/* /*
* mattackm() -- a monster attacks another monster. * mattackm() -- a monster attacks another monster.

View File

@@ -14,9 +14,7 @@
STATIC_DCL boolean FDECL(restrap,(struct monst *)); STATIC_DCL boolean FDECL(restrap,(struct monst *));
STATIC_DCL long FDECL(mm_aggression, (struct monst *,struct monst *)); STATIC_DCL long FDECL(mm_aggression, (struct monst *,struct monst *));
#ifdef BARGETHROUGH
STATIC_DCL long FDECL(mm_displacement, (struct monst *,struct monst *)); STATIC_DCL long FDECL(mm_displacement, (struct monst *,struct monst *));
#endif
STATIC_DCL int NDECL(pick_animal); STATIC_DCL int NDECL(pick_animal);
STATIC_DCL void FDECL(kill_eggs, (struct obj *)); STATIC_DCL void FDECL(kill_eggs, (struct obj *));
STATIC_DCL void FDECL(dealloc_mextra, (struct mextra *)); STATIC_DCL void FDECL(dealloc_mextra, (struct mextra *));
@@ -1083,13 +1081,6 @@ nexttry: /* eels prefer the water, but if there is no water nearby,
struct monst *mtmp2 = m_at(nx, ny); struct monst *mtmp2 = m_at(nx, ny);
long mmflag = flag | mm_aggression(mon, mtmp2); long mmflag = flag | mm_aggression(mon, mtmp2);
#ifndef BARGETHROUGH
if (!(mmflag & ALLOW_M)) continue;
info[cnt] |= ALLOW_M;
if (mtmp2->mtame) {
if (!(mmflag & ALLOW_TM)) continue;
info[cnt] |= ALLOW_TM;
#else /* BARGETHROUGH */
if (mmflag & ALLOW_M) { if (mmflag & ALLOW_M) {
info[cnt] |= ALLOW_M; info[cnt] |= ALLOW_M;
if (mtmp2->mtame) { if (mtmp2->mtame) {
@@ -1100,7 +1091,6 @@ nexttry: /* eels prefer the water, but if there is no water nearby,
mmflag = flag | mm_displacement(mon, mtmp2); mmflag = flag | mm_displacement(mon, mtmp2);
if (!(mmflag & ALLOW_MDISP)) continue; if (!(mmflag & ALLOW_MDISP)) continue;
info[cnt] |= ALLOW_MDISP; info[cnt] |= ALLOW_MDISP;
#endif /* BARGETHROUGH */
} }
} }
/* Note: ALLOW_SANCT only prevents movement, not */ /* Note: ALLOW_SANCT only prevents movement, not */
@@ -1206,7 +1196,6 @@ struct monst *magr, /* monster that is currently deciding where to move */
return 0L; return 0L;
} }
#ifdef BARGETHROUGH
/* Monster displacing another monster out of the way */ /* Monster displacing another monster out of the way */
STATIC_OVL long STATIC_OVL long
mm_displacement(magr, mdef) mm_displacement(magr, mdef)
@@ -1232,7 +1221,6 @@ struct monst *magr, /* monster that is currently deciding where to move */
return ALLOW_MDISP; return ALLOW_MDISP;
return 0L; return 0L;
} }
#endif /* BARGETHROUGH */
boolean boolean
monnear(mon, x, y) monnear(mon, x, y)

View File

@@ -579,7 +579,6 @@ register struct monst *mtmp;
return(FALSE); return(FALSE);
} }
#ifdef BARGETHROUGH
/* /*
* should_displace() * should_displace()
* *
@@ -623,7 +622,6 @@ xchar gx, gy;
return TRUE; return TRUE;
return FALSE; return FALSE;
} }
#endif /* BARGETHROUGH */
/* Return values: /* Return values:
* 0: did not move, but can still attack and do other stuff. * 0: did not move, but can still attack and do other stuff.
@@ -644,9 +642,7 @@ register int after;
boolean can_open=0, can_unlock=0, doorbuster=0; boolean can_open=0, can_unlock=0, doorbuster=0;
boolean uses_items=0, setlikes=0; boolean uses_items=0, setlikes=0;
boolean avoid=FALSE; boolean avoid=FALSE;
#ifdef BARGETHROUGH
boolean better_with_displacing = FALSE; boolean better_with_displacing = FALSE;
#endif
struct permonst *ptr; struct permonst *ptr;
struct monst *mtoo; struct monst *mtoo;
schar mmoved = 0; /* not strictly nec.: chi >= 0 will do */ schar mmoved = 0; /* not strictly nec.: chi >= 0 will do */
@@ -956,19 +952,15 @@ not_special:
for(i = 0; i < cnt; i++) for(i = 0; i < cnt; i++)
if(!(info[i] & NOTONL)) avoid=TRUE; if(!(info[i] & NOTONL)) avoid=TRUE;
} }
#ifdef BARGETHROUGH
better_with_displacing = should_displace(mtmp,poss,info,cnt,gx,gy); better_with_displacing = should_displace(mtmp,poss,info,cnt,gx,gy);
#endif
for(i=0; i < cnt; i++) { for(i=0; i < cnt; i++) {
if (avoid && (info[i] & NOTONL)) continue; if (avoid && (info[i] & NOTONL)) continue;
nx = poss[i].x; nx = poss[i].x;
ny = poss[i].y; ny = poss[i].y;
#ifdef BARGETHROUGH
if (MON_AT(nx,ny) && if (MON_AT(nx,ny) &&
(info[i] & ALLOW_MDISP) && !(info[i] & ALLOW_M) && (info[i] & ALLOW_MDISP) && !(info[i] & ALLOW_M) &&
!better_with_displacing) continue; !better_with_displacing) continue;
#endif
if (appr != 0) { if (appr != 0) {
mtrk = &mtmp->mtrack[0]; mtrk = &mtmp->mtrack[0];
for(j=0; j < jcnt; mtrk++, j++) for(j=0; j < jcnt; mtrk++, j++)
@@ -1064,7 +1056,6 @@ not_special:
return 3; return 3;
} }
#ifdef BARGETHROUGH
if((info[chi] & ALLOW_MDISP)) { if((info[chi] & ALLOW_MDISP)) {
struct monst *mtmp2; struct monst *mtmp2;
int mstatus; int mstatus;
@@ -1075,7 +1066,6 @@ not_special:
if (mstatus & MM_HIT) return 1; if (mstatus & MM_HIT) return 1;
return 3; return 3;
} }
#endif /* BARGETHROUGH */
if (!m_in_out_region(mtmp,nix,niy)) if (!m_in_out_region(mtmp,nix,niy))
return 3; return 3;
@@ -1369,7 +1359,6 @@ found_you:
mtmp->muy = my; mtmp->muy = my;
} }
#ifdef BARGETHROUGH
/* /*
* mon-to-mon displacement is a deliberate "get out of my way" act, * mon-to-mon displacement is a deliberate "get out of my way" act,
* not an accidental bump, so we don't consider mstun or mconf in * not an accidental bump, so we don't consider mstun or mconf in
@@ -1401,7 +1390,6 @@ xchar x,y;
return FALSE; return FALSE;
} }
#endif /* BARGETHROUGH */
/* /*
* Inventory prevents passage under door. * Inventory prevents passage under door.

View File

@@ -1247,9 +1247,6 @@ static const char *build_opts[] = {
#ifdef MAIL #ifdef MAIL
"mail daemon", "mail daemon",
#endif #endif
#ifdef BARGETHROUGH
"monsters moving monsters",
#endif
#ifdef GNUDOS #ifdef GNUDOS
"MSDOS protected mode", "MSDOS protected mode",
#endif #endif