Give the FORCED property a real cond bit. Delete some unused code.

This commit is contained in:
Eric S. Raymond 2017-06-22 17:49:06 -04:00
parent 7f7f49b739
commit 51494657fd
4 changed files with 4 additions and 10 deletions

View file

@ -151,7 +151,7 @@ extern int restore(FILE *);
#define LIQUID() (LIQ2(game.prop[BOTTLE]<0 ? -1-game.prop[BOTTLE] : game.prop[BOTTLE]))
#define LIQLOC(LOC) (LIQ2((MOD(conditions[LOC]/2*2,8)-5)*MOD(conditions[LOC]/4,2)+1))
#define CNDBIT(L,N) (TSTBIT(conditions[L],N))
#define FORCED(LOC) (conditions[LOC] == 2)
#define FORCED(LOC) CNDBIT(LOC, COND_FORCED)
#define DARK(DUMMY) ((!TSTBIT(conditions[game.loc],COND_LIT)) && (game.prop[LAMP] == 0 || !HERE(LAMP)))
#define PCT(N) (randrange(100) < (N))
#define GSTONE(OBJ) ((OBJ) == EMERALD || (OBJ) == RUBY || (OBJ) == AMBER || (OBJ) == SAPPH)

View file

@ -16,7 +16,8 @@ extern const char ascii_to_advent[128];
#define COND_NOBACK 4 /* Cannot use "back" to move away */
#define COND_ABOVE 5
#define COND_DEEP 6 /* Deep - e.g where dwarves are active */
#define COND_FOREST 7 /* in the forest */
#define COND_FOREST 7 /* In the forest */
#define COND_FORCED 8 /* Only one way in or out of here */
/* Bits past 10 indicate areas of interest to "hint" routines */
#define COND_HBASE 10 /* Base for location hint bits */
#define COND_HCAVE 11 /* Trying to get into cave */

View file

@ -52,13 +52,6 @@ long PLAC[NOBJECTS + 1];
long FIXD[NOBJECTS + 1];
long ACTSPK[VRBSIZ + 1];
static bool is_set(long var, long position)
{
long mask = 1L << position;
bool result = (var & mask) == mask;
return (result);
}
static long GETTXT(long SKIP, long ONEWRD, long UPPER)
{
/* Take characters from an input line and pack them into 30-bit words.

2
init.c
View file

@ -185,7 +185,7 @@ void initialise(void)
if (!(locations[i].description.big == 0 || KEY[i] == 0)) {
int k = KEY[i];
if (MOD(labs(TRAVEL[k]), 1000) == 1)
conditions[i] = 2;
conditions[i] |= (1 << COND_FORCED);
}
game.atloc[i] = 0;
}