From 69145189c9ed3dba15ac92838cb5d184503cac2a Mon Sep 17 00:00:00 2001 From: Steve Date: Wed, 14 Feb 2018 07:12:47 +0000 Subject: [PATCH] Fixed key carrying message bug. --- src/entities/items/item.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/entities/items/item.c b/src/entities/items/item.c index 78c8097..ea88f23 100644 --- a/src/entities/items/item.c +++ b/src/entities/items/item.c @@ -134,17 +134,19 @@ static void bobPickupItem(void) { if (i->thinkTime == 0) { - addItem(i); - game.stats[STAT_KEYS_FOUND]++; - updateObjective("KEY"); + if (addItem(i)) + { + game.stats[STAT_KEYS_FOUND]++; + updateObjective("KEY"); - setGameplayMessage(MSG_STANDARD, _("Picked up a %s"), i->name); + setGameplayMessage(MSG_STANDARD, _("Picked up a %s"), i->name); - playSound(SND_KEY, CH_ITEM); - } - else - { - setGameplayMessage(MSG_GAMEPLAY, _("Can't carry any more keys")); + playSound(SND_KEY, CH_ITEM); + } + else + { + setGameplayMessage(MSG_GAMEPLAY, _("Can't carry any more keys")); + } } } else if (i->canBeCarried)