Introduce OBJECT_STASHIFY.

This commit is contained in:
Eric S. Raymond 2024-09-22 22:34:07 -04:00
parent 0157e58668
commit 08f0351817
3 changed files with 3 additions and 3 deletions

View file

@ -100,6 +100,7 @@
#define OBJECT_IS_NOTFOUND2(g, o) (!g.objects[o].found) #define OBJECT_IS_NOTFOUND2(g, o) (!g.objects[o].found)
#define OBJECT_SET_SEEN(obj) game.objects[object].found = true #define OBJECT_SET_SEEN(obj) game.objects[object].found = true
#endif #endif
#define OBJECT_STASHIFY(obj, pval) game.objects[obj].prop = PROP_STASHIFY(pval)
#define PROMPT "> " #define PROMPT "> "

3
main.c
View file

@ -1275,8 +1275,7 @@ static bool do_command(void) {
if (TOTING(i) && if (TOTING(i) &&
(OBJECT_IS_NOTFOUND(i) || (OBJECT_IS_NOTFOUND(i) ||
OBJECT_IS_STASHED(i))) { OBJECT_IS_STASHED(i))) {
game.objects[i].prop = OBJECT_STASHIFY(i, game.objects[i].prop);
PROP_STASHIFY(game.objects[i].prop);
} }
} }
} }

2
misc.c
View file

@ -625,7 +625,7 @@ void put(obj_t object, loc_t where, int pval) {
/* put() is the same as move(), except the object is stashed and /* put() is the same as move(), except the object is stashed and
* can no longer be picked up. */ * can no longer be picked up. */
move(object, where); move(object, where);
game.objects[object].prop = PROP_STASHIFY(pval); OBJECT_STASHIFY(object, pval);
#ifdef OBJECT_SET_SEEN #ifdef OBJECT_SET_SEEN
OBJECT_SET_SEEN(object); OBJECT_SET_SEEN(object);
#endif #endif