More magic-number removal.
authorEric S. Raymond <esr@thyrsus.com>
Wed, 28 Jun 2017 21:29:33 +0000 (17:29 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Wed, 28 Jun 2017 21:29:33 +0000 (17:29 -0400)
actions.c
adventure.yaml

index 677b609b81ede532aba9b26bc75cabb334a5e25f..910d46c2eb555745959c081a20c461b249ec2552 100644 (file)
--- a/actions.c
+++ b/actions.c
@@ -288,7 +288,7 @@ static int vcarry(token_t verb, token_t obj)
         game.place[LIQUID()] = CARRIED;
     if (GSTONE(obj) && game.prop[obj] != 0) {
         game.prop[obj] = 0;
         game.place[LIQUID()] = CARRIED;
     if (GSTONE(obj) && game.prop[obj] != 0) {
         game.prop[obj] = 0;
-        game.prop[CAVITY] = 1;
+        game.prop[CAVITY] = CAVITY_EMPTY;
     }
     rspeak(OK_MAN);
     return GO_CLEAROBJ;
     }
     rspeak(OK_MAN);
     return GO_CLEAROBJ;
@@ -350,12 +350,12 @@ static int discard(token_t verb, token_t obj, bool just_do_it)
             if (game.closed) return GO_DWARFWAKE;
             DESTROY(SNAKE);
             /* Set game.prop for use by travel options */
             if (game.closed) return GO_DWARFWAKE;
             DESTROY(SNAKE);
             /* Set game.prop for use by travel options */
-            game.prop[SNAKE] = 1;
+            game.prop[SNAKE] = SNAKE_CHASED;
 
 
-        } else if ((GSTONE(obj) && AT(CAVITY) && game.prop[CAVITY] != 0)) {
+        } else if ((GSTONE(obj) && AT(CAVITY) && game.prop[CAVITY] != CAVITY_FULL)) {
             rspeak(GEM_FITS);
             game.prop[obj] = 1;
             rspeak(GEM_FITS);
             game.prop[obj] = 1;
-            game.prop[CAVITY] = 0;
+            game.prop[CAVITY] = CAVITY_FULL;
             if (HERE(RUG) && ((obj == EMERALD && game.prop[RUG] != 2) || (obj == RUBY &&
                               game.prop[RUG] == 2))) {
                 spk = RUG_RISES;
             if (HERE(RUG) && ((obj == EMERALD && game.prop[RUG] != 2) || (obj == RUBY &&
                               game.prop[RUG] == 2))) {
                 spk = RUG_RISES;
index 1e7bc3210f227342b6ac6b7d57453ce71ce15347..2228016bf1b79774f66690216f300e9b0122b341 100644 (file)
@@ -3363,8 +3363,8 @@ objects: !!omap
     locations: LOC_NOWHERE
     immovable: true
     descriptions:
     locations: LOC_NOWHERE
     immovable: true
     descriptions:
-    - '' # something in it
-    - 'There is a small urn-shaped cavity in the rock.'
+    - [CAVITY_FULL, ''] # something in it
+    - [CAVITY_EMPTY, 'There is a small urn-shaped cavity in the rock.']
 - BLOOD:
     words: ['blood']
     inventory: '*blood'
 - BLOOD:
     words: ['blood']
     inventory: '*blood'