From 469a0e74edf212e5edd1264306b1d14f3f35b71c Mon Sep 17 00:00:00 2001 From: NHOrus Date: Tue, 4 Jul 2017 14:38:43 +0300 Subject: [PATCH] linearized drink --- actions.c | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/actions.c b/actions.c index 5fa2fed..ecb5c19 100644 --- a/actions.c +++ b/actions.c @@ -521,24 +521,30 @@ static int drink(token_t verb, token_t obj) /* Drink. If no object, assume water and look for it here. If water is in * the bottle, drink that, else must be at a water loc, so drink stream. */ { - if (obj == NO_OBJECT && LIQLOC(game.loc) != WATER && (LIQUID() != WATER || - !HERE(BOTTLE))) + if (obj == NO_OBJECT && LIQLOC(game.loc) != WATER && + (LIQUID() != WATER || !HERE(BOTTLE))) { return GO_UNKNOWN; - if (obj != BLOOD) { - if (obj != NO_OBJECT && obj != WATER) { - rspeak(RIDICULOUS_ATTEMPT); - } else if (LIQUID() == WATER && HERE(BOTTLE)) { - game.prop[BOTTLE] = EMPTY_BOTTLE; - game.place[WATER] = LOC_NOWHERE; - rspeak(BOTTLE_EMPTY); - } else { - rspeak(actions[verb].message); - } - } else { + } + + if (obj == BLOOD) { DESTROY(BLOOD); state_change(DRAGON, DRAGON_BLOODLESS); game.blooded = true; + return GO_CLEAROBJ; } + + if (obj != NO_OBJECT && obj != WATER) { + rspeak(RIDICULOUS_ATTEMPT); + return GO_CLEAROBJ; + } + if (LIQUID() == WATER && HERE(BOTTLE)) { + game.prop[BOTTLE] = EMPTY_BOTTLE; + game.place[WATER] = LOC_NOWHERE; + rspeak(BOTTLE_EMPTY); + return GO_CLEAROBJ; + } + + rspeak(actions[verb].message); return GO_CLEAROBJ; } -- 2.31.1