From: Christoph Sommer Date: Wed, 13 Jun 2007 18:27:37 +0000 (+0000) Subject: Fixed typo in Block.cpp that kept bonus blocks from knocking (temporarily) non(!... X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=708f8c7a02f5e88339408ccf6f93dbc5aeded402;p=supertux.git Fixed typo in Block.cpp that kept bonus blocks from knocking (temporarily) non(!)-portable badguys (resolves issue 225) SVN-Revision: 5103 --- diff --git a/src/object/block.cpp b/src/object/block.cpp index 395c33b3c..fd6e2fc21 100644 --- a/src/object/block.cpp +++ b/src/object/block.cpp @@ -74,16 +74,25 @@ Block::collision(GameObject& other, const CollisionHit& ) } } + // only interact with other objects if... + // 1) we are bouncing + // and + // 2) the object is not portable (either never or not currently) Portable* portable = dynamic_cast (&other); - if(bouncing && (portable == 0 || portable->is_portable())) { + if(bouncing && (portable == 0 || (!portable->is_portable()))) { + + // Badguys get killed BadGuy* badguy = dynamic_cast (&other); if(badguy) { badguy->kill_fall(); } + + // Coins get collected Coin* coin = dynamic_cast (&other); if(coin) { coin->collect(); } + } return SOLID;