Abstract out some state arithmetic.
[open-adventure.git] / actions.c
index fdd1c9341e1fb911ac000fbe6241699638115dc5..ec17c07b2145254be33b052c1700b9912df1f8a6 100644 (file)
--- a/actions.c
+++ b/actions.c
@@ -361,7 +361,7 @@ static int vcarry(token_t verb, token_t obj)
 
     }
 
-    if (obj == BIRD && game.prop[BIRD] != BIRD_CAGED && -1 - game.prop[BIRD] != BIRD_CAGED) {
+    if (obj == BIRD && game.prop[BIRD] != BIRD_CAGED && STASHED(BIRD) != BIRD_CAGED) {
         if (game.prop[BIRD] == BIRD_FOREST_UNCAGED) {
             DESTROY(BIRD);
             rspeak(BIRD_CRAP);
@@ -380,8 +380,7 @@ static int vcarry(token_t verb, token_t obj)
     /* FIXME: Arithmetic on state numbers */
     if ((obj == BIRD ||
          obj == CAGE) &&
-        (game.prop[BIRD] == BIRD_CAGED ||
-         -1 - game.prop[BIRD] == 1))
+        (game.prop[BIRD] == BIRD_CAGED || STASHED(BIRD) == BIRD_CAGED))
         carry(BIRD + CAGE - obj, game.loc);
     carry(obj, game.loc);
     if (obj == BOTTLE && LIQUID() != NO_OBJECT)
@@ -451,7 +450,7 @@ static int discard(token_t verb, token_t obj, bool just_do_it)
         if (TOTING(ROD2) && obj == ROD && !TOTING(ROD))
             obj = ROD2;
         if (!TOTING(obj)) {
-            rspeak(actions[verb].message;);
+            rspeak(actions[verb].message);
             return GO_CLEAROBJ;
         }
         if (obj == BIRD && HERE(SNAKE)) {
@@ -692,7 +691,7 @@ int fill(token_t verb, token_t obj)
         rspeak(SHATTER_VASE);
         game.prop[VASE] = VASE_BROKEN;
         game.fixed[VASE] = -1;
-        return (discard(verb, obj, true));
+        return (discard(verb, VASE, true));
     }
 
     if (obj == URN) {