Unspk and streamline eat command
authorNHOrus <jy6x2b32pie9@yahoo.com>
Mon, 3 Jul 2017 03:07:57 +0000 (06:07 +0300)
committerNHOrus <jy6x2b32pie9@yahoo.com>
Mon, 3 Jul 2017 03:07:57 +0000 (06:07 +0300)
actions.c
tests/wakedwarves2.log

index 44fc2012e3f7f8085b6db7f2e03c033f926bd2ff..5dfb987a74f8e92ce02edd9ca36bb3defd1591b0 100644 (file)
--- a/actions.c
+++ b/actions.c
@@ -518,23 +518,25 @@ static int eat(token_t verb, token_t obj)
 /*  Eat.  Intransitive: assume food if present, else ask what.  Transitive: food
  *  ok, some things lose appetite, rest are ridiculous. */
 {
-    int spk = actions[verb].message;
     if (obj == INTRANSITIVE) {
         if (!HERE(FOOD))
             return GO_UNKNOWN;
         DESTROY(FOOD);
-        spk = THANKS_DELICIOUS;
-    } else {
-        if (obj == FOOD) {
-            DESTROY(FOOD);
-            spk = THANKS_DELICIOUS;
-        }
-        if (obj == BIRD || obj == SNAKE || obj == CLAM || obj == OYSTER || obj ==
-            DWARF || obj == DRAGON || obj == TROLL || obj == BEAR || obj ==
-            OGRE)
-            spk = LOST_APPETITE;
+        rspeak(THANKS_DELICIOUS);
+        return GO_CLEAROBJ;
     }
-    rspeak(spk);
+    if (obj == FOOD) {
+        DESTROY(FOOD);
+        rspeak(THANKS_DELICIOUS);
+        return GO_CLEAROBJ;
+    }
+    if (obj == BIRD || obj == SNAKE || obj == CLAM || obj == OYSTER || obj ==
+        DWARF || obj == DRAGON || obj == TROLL || obj == BEAR || obj ==
+        OGRE) {
+        rspeak(LOST_APPETITE);
+        return GO_CLEAROBJ;
+    }
+    rspeak(actions[verb].message);
     return GO_CLEAROBJ;
 }
 
index bead5dba47949280cb599d9bbd9c0db62c691993..ac3862ad5736f5ecf201f63b6136016f8cec3fd3 100644 (file)
@@ -1,4 +1,4 @@
-## Wake the dwarves and die.
+## Wake the dwarves differently and die.
 n
 seed 1838473132
 in