Fixed typo in Block.cpp that kept bonus blocks from knocking (temporarily) non(!...
authorChristoph Sommer <mail@christoph-sommer.de>
Wed, 13 Jun 2007 18:27:37 +0000 (18:27 +0000)
committerChristoph Sommer <mail@christoph-sommer.de>
Wed, 13 Jun 2007 18:27:37 +0000 (18:27 +0000)
SVN-Revision: 5103

src/object/block.cpp

index 395c33b..fd6e2fc 100644 (file)
@@ -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<Portable*> (&other);
-  if(bouncing && (portable == 0 || portable->is_portable())) {
+  if(bouncing && (portable == 0 || (!portable->is_portable()))) {
+
+    // Badguys get killed
     BadGuy* badguy = dynamic_cast<BadGuy*> (&other);
     if(badguy) {
       badguy->kill_fall();
     }
+
+    // Coins get collected
     Coin* coin = dynamic_cast<Coin*> (&other);
     if(coin) {
       coin->collect();
     }
+
   }
 
   return SOLID;