linearized drink
authorNHOrus <jy6x2b32pie9@yahoo.com>
Tue, 4 Jul 2017 11:38:43 +0000 (14:38 +0300)
committerNHOrus <jy6x2b32pie9@yahoo.com>
Tue, 4 Jul 2017 12:18:49 +0000 (15:18 +0300)
actions.c

index 5fa2fedbb9e715fa4aa5f8246a1acddd57857f93..ecb5c199e387de9acd6b3b577eaba9270c418498 100644 (file)
--- a/actions.c
+++ b/actions.c
@@ -521,24 +521,30 @@ static int drink(token_t verb, token_t obj)
 /*  Drink.  If no object, assume water and look for it here.  If water is in
  *  the bottle, drink that, else must be at a water loc, so drink stream. */
 {
-    if (obj == NO_OBJECT && LIQLOC(game.loc) != WATER && (LIQUID() != WATER ||
-            !HERE(BOTTLE)))
+    if (obj == NO_OBJECT && LIQLOC(game.loc) != WATER &&
+        (LIQUID() != WATER || !HERE(BOTTLE))) {
         return GO_UNKNOWN;
-    if (obj != BLOOD) {
-        if (obj != NO_OBJECT && obj != WATER) {
-            rspeak(RIDICULOUS_ATTEMPT);
-        } else if (LIQUID() == WATER && HERE(BOTTLE)) {
-            game.prop[BOTTLE] = EMPTY_BOTTLE;
-            game.place[WATER] = LOC_NOWHERE;
-            rspeak(BOTTLE_EMPTY);
-        } else {
-            rspeak(actions[verb].message);
-        }
-    } else {
+    }
+
+    if (obj == BLOOD) {
         DESTROY(BLOOD);
         state_change(DRAGON, DRAGON_BLOODLESS);
         game.blooded = true;
+        return GO_CLEAROBJ;
     }
+
+    if (obj != NO_OBJECT && obj != WATER) {
+        rspeak(RIDICULOUS_ATTEMPT);
+        return GO_CLEAROBJ;
+    }
+    if (LIQUID() == WATER && HERE(BOTTLE)) {
+        game.prop[BOTTLE] = EMPTY_BOTTLE;
+        game.place[WATER] = LOC_NOWHERE;
+        rspeak(BOTTLE_EMPTY);
+        return GO_CLEAROBJ;
+    }
+
+    rspeak(actions[verb].message);
     return GO_CLEAROBJ;
 }