Don't kill badguys twice when hitting spike after falling after being squished
authorTobias Markus <tobbi@mozilla-uk.org>
Thu, 22 Aug 2013 12:37:25 +0000 (14:37 +0200)
committerTobias Markus <tobbi@mozilla-uk.org>
Sat, 26 Oct 2013 16:45:18 +0000 (18:45 +0200)
src/badguy/badguy.cpp

index 46c0d70..8cbec1d 100644 (file)
@@ -219,6 +219,9 @@ BadGuy::inactive_update(float )
 void
 BadGuy::collision_tile(uint32_t tile_attributes)
 {
+  // Don't kill badguys that have already been killed
+  if (!is_active()) return;
+
   if(tile_attributes & Tile::HURTS) {
     if (tile_attributes & Tile::FIRE) {
       if (is_flammable()) ignite();