Reflow.
This commit is contained in:
parent
20fd7c589f
commit
9c3f4b0c90
2 changed files with 9 additions and 8 deletions
6
advent.h
6
advent.h
|
@ -87,11 +87,11 @@
|
||||||
#define PROP_IS_INVALID(val) (val < -MAX_STATE || val > MAX_STATE)
|
#define PROP_IS_INVALID(val) (val < -MAX_STATE || val > MAX_STATE)
|
||||||
#define OBJECT_IS_STASHED(obj) (game.objects[obj].prop < 0)
|
#define OBJECT_IS_STASHED(obj) (game.objects[obj].prop < 0)
|
||||||
#define OBJECT_IS_NOTFOUND(obj) (!game.objects[obj].found)
|
#define OBJECT_IS_NOTFOUND(obj) (!game.objects[obj].found)
|
||||||
#define OBJECT_IS_FOUND(obj) \
|
#define OBJECT_IS_FOUND(obj) \
|
||||||
(game.objects[obj].found && game.objects[obj].prop == 0)
|
(game.objects[obj].found && game.objects[obj].prop == 0)
|
||||||
#define OBJECT_IS_STASHED_OR_UNSEEN(obj) \
|
#define OBJECT_IS_STASHED_OR_UNSEEN(obj) \
|
||||||
(!game.objects[obj].found || game.objects[obj].prop < 0)
|
(!game.objects[obj].found || game.objects[obj].prop < 0)
|
||||||
#define OBJECT_SET_FOUND(obj) \
|
#define OBJECT_SET_FOUND(obj) \
|
||||||
do { \
|
do { \
|
||||||
game.objects[obj].found = true; \
|
game.objects[obj].found = true; \
|
||||||
game.objects[obj].prop = STATE_FOUND; \
|
game.objects[obj].prop = STATE_FOUND; \
|
||||||
|
|
9
main.c
9
main.c
|
@ -1272,8 +1272,9 @@ static bool do_command(void) {
|
||||||
pspeak(OYSTER, look, true, 1);
|
pspeak(OYSTER, look, true, 1);
|
||||||
}
|
}
|
||||||
for (size_t i = 1; i <= NOBJECTS; i++) {
|
for (size_t i = 1; i <= NOBJECTS; i++) {
|
||||||
if (TOTING(i) && (OBJECT_IS_NOTFOUND(i) ||
|
if (TOTING(i) &&
|
||||||
OBJECT_IS_STASHED(i))) {
|
(OBJECT_IS_NOTFOUND(i) ||
|
||||||
|
OBJECT_IS_STASHED(i))) {
|
||||||
game.objects[i].prop =
|
game.objects[i].prop =
|
||||||
OBJECT_STASHED(i);
|
OBJECT_STASHED(i);
|
||||||
}
|
}
|
||||||
|
@ -1284,8 +1285,8 @@ static bool do_command(void) {
|
||||||
game.wzdark = DARK(game.loc);
|
game.wzdark = DARK(game.loc);
|
||||||
|
|
||||||
/* If the knife is not here it permanently disappears.
|
/* If the knife is not here it permanently disappears.
|
||||||
* Possibly this should fire if the knife is here but
|
* Possibly this should fire if the knife is here but
|
||||||
* the room is dark? */
|
* the room is dark? */
|
||||||
if (game.knfloc > LOC_NOWHERE &&
|
if (game.knfloc > LOC_NOWHERE &&
|
||||||
game.knfloc != game.loc) {
|
game.knfloc != game.loc) {
|
||||||
game.knfloc = LOC_NOWHERE;
|
game.knfloc = LOC_NOWHERE;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue