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

index 2b97800482ed58211fa9ed83c915eacb5cb33dff..5fa2fedbb9e715fa4aa5f8246a1acddd57857f93 100644 (file)
--- a/actions.c
+++ b/actions.c
@@ -582,9 +582,7 @@ static int extinguish(token_t verb, int obj)
             obj = LAMP;
         if (HERE(URN) && game.prop[URN] == URN_LIT)
             obj = URN;
-        if (obj == INTRANSITIVE ||
-            (HERE(LAMP) && game.prop[LAMP] == LAMP_BRIGHT &&
-             HERE(URN) && game.prop[URN] == URN_LIT))
+        if (obj == INTRANSITIVE)
             return GO_UNKNOWN;
     }
 
@@ -594,20 +592,24 @@ static int extinguish(token_t verb, int obj)
         } else {
             pspeak(URN, change, URN_DARK, true);
         }
+        return GO_CLEAROBJ;
+    }
 
-    } else if (obj == LAMP) {
+    if (obj == LAMP) {
         state_change(LAMP, LAMP_DARK);
         rspeak(DARK(game.loc) ?
                PITCH_DARK :
                NO_MESSAGE);
+        return GO_CLEAROBJ;
+    }
 
-    } else if (obj == DRAGON ||
-               obj == VOLCANO) {
+    if (obj == DRAGON ||
+        obj == VOLCANO) {
         rspeak(BEYOND_POWER);
-
-    } else {
-        rspeak(actions[verb].message);
+        return GO_CLEAROBJ;
     }
+
+    rspeak(actions[verb].message);
     return GO_CLEAROBJ;
 }