Confine use of STATE_NOTFOUND to macros.
This commit is contained in:
parent
9e9731d59b
commit
1af01ff91f
3 changed files with 5 additions and 4 deletions
1
advent.h
1
advent.h
|
@ -61,6 +61,7 @@
|
|||
#define PROP_IS_STASHED_OR_UNSEEN(obj) (game.objects[obj].prop < 0)
|
||||
#define PROP_SET_FOUND(obj) (game.objects[obj].prop = STATE_FOUND)
|
||||
#define PROP_SET_NOT_FOUND(obj) (game.objects[obj].prop = STATE_NOTFOUND)
|
||||
#define PROP_IS_NOTFOUND2(g, o) (g.objects[o].prop == STATE_NOTFOUND)
|
||||
|
||||
#define PROMPT "> "
|
||||
|
||||
|
|
6
main.c
6
main.c
|
@ -859,8 +859,8 @@ static bool closecheck(void)
|
|||
* objects come from known locations and/or states (e.g. the
|
||||
* snake is known to have been destroyed and needn't be
|
||||
* carried away from its old "place"), making the various
|
||||
* objects be handled differently. We also drop all other
|
||||
* objects he might be carrying (lest he have some which
|
||||
* objects be handled differently. We also drop all other
|
||||
* objects he might be acrrying (lest he have some which
|
||||
* could cause trouble, such as the keys). We describe the
|
||||
* flash of light and trundle back. */
|
||||
put(BOTTLE, LOC_NE, EMPTY_BOTTLE);
|
||||
|
@ -868,7 +868,7 @@ static bool closecheck(void)
|
|||
put(OYSTER, LOC_NE, STATE_FOUND);
|
||||
put(LAMP, LOC_NE, LAMP_DARK);
|
||||
put(ROD, LOC_NE, STATE_FOUND);
|
||||
put(DWARF, LOC_NE, 0);
|
||||
put(DWARF, LOC_NE, STATE_FOUND);
|
||||
game.loc = LOC_NE;
|
||||
game.oldloc = LOC_NE;
|
||||
game.newloc = LOC_NE;
|
||||
|
|
|
@ -218,7 +218,7 @@ bool is_valid(struct game_t valgame)
|
|||
int temp_tally = 0;
|
||||
for (int treasure = 1; treasure <= NOBJECTS; treasure++) {
|
||||
if (objects[treasure].is_treasure) {
|
||||
if (valgame.objects[treasure].prop == STATE_NOTFOUND) {
|
||||
if (PROP_IS_NOTFOUND2(valgame, treasure)) {
|
||||
++temp_tally;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue