From: Matthias Braun Date: Wed, 26 Apr 2006 10:15:34 +0000 (+0000) Subject: fix exception getting thrown although argument was correct X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=0567180a51b0d9483dae9336c6e31a25a424050e;p=supertux.git fix exception getting thrown although argument was correct SVN-Revision: 3439 --- diff --git a/src/object/player.cpp b/src/object/player.cpp index c17f0b824..59b7d5760 100644 --- a/src/object/player.cpp +++ b/src/object/player.cpp @@ -543,19 +543,19 @@ Player::add_coins(int count) void Player::add_bonus(const std::string& bonustype) { - if(bonustype == "grow") + if(bonustype == "grow") { add_bonus(GROWUP_BONUS); - else if(bonustype == "fireflower") + } else if(bonustype == "fireflower") { add_bonus(FIRE_BONUS); - else if(bonustype == "iceflower") + } else if(bonustype == "iceflower") { add_bonus(ICE_BONUS); - else if(bonustype == "none") + } else if(bonustype == "none") { add_bonus(NO_BONUS); - - - std::ostringstream msg; - msg << "Unknown bonus type " << bonustype; - throw std::runtime_error(msg.str()); + } else { + std::ostringstream msg; + msg << "Unknown bonus type " << bonustype; + throw std::runtime_error(msg.str()); + } } void