Clear login in bvreak
authorNHOrus <jy6x2b32pie9@yahoo.com>
Thu, 6 Jul 2017 15:23:07 +0000 (18:23 +0300)
committerNHOrus <jy6x2b32pie9@yahoo.com>
Thu, 6 Jul 2017 15:23:07 +0000 (18:23 +0300)
Test double-breaking of vase

actions.c
tests/breakvase.chk
tests/breakvase.log

index ab3ccda319f9e26ab1802fad2378cecb1d0cb10a..5cf1fae0a77bbe7cd0f44081d08622217c5d8983 100644 (file)
--- a/actions.c
+++ b/actions.c
@@ -248,23 +248,26 @@ static void blast(void)
 static int vbreak(vocab_t verb, obj_t obj)
 /*  Break.  Only works for mirror in repository and, of course, the vase. */
 {
-    if (obj == MIRROR) {
+    switch (obj) {
+    case MIRROR:
         if (game.closed) {
             rspeak(BREAK_MIRROR);
             return GO_DWARFWAKE;
         } else {
             rspeak(TOO_FAR);
-            return GO_CLEAROBJ;
+            break;
         }
+    case VASE:
+        if (game.prop[VASE] == VASE_WHOLE) {
+            if (TOTING(VASE))
+                drop(VASE, game.loc);
+            state_change(VASE, VASE_BROKEN);
+            game.fixed[VASE] = IS_FIXED;
+            break;
+        }
+    default:
+        speak(actions[verb].message);
     }
-    if (obj == VASE && game.prop[VASE] == VASE_WHOLE) {
-        if (TOTING(VASE))
-            drop(VASE, game.loc);
-        state_change(VASE, VASE_BROKEN);
-        game.fixed[VASE] = IS_FIXED;
-        return GO_CLEAROBJ;
-    }
-    speak(actions[verb].message);
     return (GO_CLEAROBJ);
 }
 
index 34f510ae3d5bf2ceddc5cf78f602af50ce1cbbe9..c1adb2730beef13ba2672b63c187e3ff42c8c1a2 100644 (file)
@@ -1298,6 +1298,10 @@ OK
 
 You have taken the vase and hurled it delicately to the ground.
 
+> break vase
+
+It is beyond your power to do that.
+
 > quit
 
 Do you really want to quit now?
@@ -1306,7 +1310,7 @@ Do you really want to quit now?
 
 OK
 
-You scored 139 out of a possible 430, using 211 turns.
+You scored 139 out of a possible 430, using 212 turns.
 
 You have achieved the rating: "Experienced Adventurer".
 
index 1db995711e47842e1a6867094b76794282435030..d55c4393f2076a0220354c91b6c2623e33daf34c 100644 (file)
@@ -216,5 +216,6 @@ s
 # Previous was just setup - this is the real test 
 take vase
 break vase
+break vase
 quit
 yes