Prevent multiple assigment to game.bonus in blast
authorNHOrus <jy6x2b32pie9@yahoo.com>
Thu, 6 Jul 2017 15:18:31 +0000 (18:18 +0300)
committerNHOrus <jy6x2b32pie9@yahoo.com>
Thu, 6 Jul 2017 15:18:31 +0000 (18:18 +0300)
actions.c

index 2c28663b80cbd15b32d476d8ed0d6fd294e89906..ab3ccda319f9e26ab1802fad2378cecb1d0cb10a 100644 (file)
--- a/actions.c
+++ b/actions.c
@@ -230,15 +230,16 @@ static int bigwords(long id)
 static void blast(void)
 /*  Blast.  No effect unless you've got dynamite, which is a neat trick! */
 {
-    if (game.prop[ROD2] < 0 ||
+    if (game.prop[ROD2] == STATE_NOTFOUND ||
         !game.closed)
         rspeak(REQUIRES_DYNAMITE);
     else {
-        game.bonus = VICTORY_MESSAGE;
-        if (game.loc == LOC_NE)
-            game.bonus = DEFEAT_MESSAGE;
         if (HERE(ROD2))
             game.bonus = SPLATTER_MESSAGE;
+        else if (game.loc == LOC_NE)
+            game.bonus = DEFEAT_MESSAGE;
+        else
+            game.bonus = VICTORY_MESSAGE;
         rspeak(game.bonus);
         terminate(endgame);
     }