From: Eric S. Raymond Date: Mon, 23 Sep 2024 02:34:07 +0000 (-0400) Subject: Introduce OBJECT_STASHIFY. X-Git-Tag: 1.20~8 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=08f0351817b54e76f33609b12deec52e8efbcd4c;p=open-adventure.git Introduce OBJECT_STASHIFY. --- diff --git a/advent.h b/advent.h index 9841037..d1504f0 100644 --- a/advent.h +++ b/advent.h @@ -100,6 +100,7 @@ #define OBJECT_IS_NOTFOUND2(g, o) (!g.objects[o].found) #define OBJECT_SET_SEEN(obj) game.objects[object].found = true #endif +#define OBJECT_STASHIFY(obj, pval) game.objects[obj].prop = PROP_STASHIFY(pval) #define PROMPT "> " diff --git a/main.c b/main.c index 688cfc7..14c9065 100644 --- a/main.c +++ b/main.c @@ -1275,8 +1275,7 @@ static bool do_command(void) { if (TOTING(i) && (OBJECT_IS_NOTFOUND(i) || OBJECT_IS_STASHED(i))) { - game.objects[i].prop = - PROP_STASHIFY(game.objects[i].prop); + OBJECT_STASHIFY(i, game.objects[i].prop); } } } diff --git a/misc.c b/misc.c index 9fddfd5..b28949e 100644 --- a/misc.c +++ b/misc.c @@ -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 * can no longer be picked up. */ move(object, where); - game.objects[object].prop = PROP_STASHIFY(pval); + OBJECT_STASHIFY(object, pval); #ifdef OBJECT_SET_SEEN OBJECT_SET_SEEN(object); #endif