From: NHOrus Date: Thu, 6 Jul 2017 15:18:31 +0000 (+0300) Subject: Prevent multiple assigment to game.bonus in blast X-Git-Tag: 2017-07-10~45 X-Git-Url: https://jxself.org/git/?p=open-adventure.git;a=commitdiff_plain;h=0a04293f23d9c3cc2a057c9130c71832d2375e06;hp=adab8e21904dc79932eede14dbac8d6cfa710426 Prevent multiple assigment to game.bonus in blast --- diff --git a/actions.c b/actions.c index 2c28663..ab3ccda 100644 --- 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); }