Now it shouyld be possible to manipulate a stashed flag by only
changing macros.
game.objects[BIRD].prop = BIRD_CAGED;
}
if ((obj == BIRD || obj == CAGE) &&
- (game.objects[BIRD].prop == BIRD_CAGED ||
- PROP_STASHIFY(game.objects[BIRD].prop) == BIRD_CAGED)) {
+ OBJECT_STATE_EQUALS(BIRD, BIRD_CAGED)) {
/* expression maps BIRD to CAGE and CAGE to BIRD */
carry(BIRD + CAGE - obj, game.loc);
}
#define OBJECT_SET_FOUND(obj) (game.objects[obj].prop = STATE_FOUND)
#define OBJECT_SET_NOT_FOUND(obj) (game.objects[obj].prop = STATE_NOTFOUND)
#define OBJECT_IS_NOTFOUND2(g, o) (g.objects[o].prop == STATE_NOTFOUND)
+#define OBJECT_STATE_EQUALS(obj, pval) ((game.objects[obj].prop == pval) || (game.objects[obj].prop == PROP_STASHIFY(pval)))
#else
/* (ESR) Only the boldest of adventurers will explore here. This
* alternate set of definitions for the macros above was an attempt to