-Incorporated Marcin Ko��cielnicki patch that reintroduces the flying
[supertux.git] / src / badguy / badguy.cpp
index b075dd1..4a20978 100644 (file)
@@ -1,7 +1,7 @@
 #include <config.h>
 
 #include "badguy.h"
-#include "camera.h"
+#include "object/camera.h"
 
 static const float SQUISH_TIME = 2;
 static const float X_OFFSCREEN_DISTANCE = 1600;
@@ -97,7 +97,7 @@ BadGuy::collision(GameObject& other, const CollisionHit& hit)
         return collision_solid(other, hit);
 
       BadGuy* badguy = dynamic_cast<BadGuy*> (&other);
-      if(badguy)
+      if(badguy && badguy->state == STATE_ACTIVE)
         return collision_badguy(*badguy, hit);
 
       Player* player = dynamic_cast<Player*> (&other);
@@ -155,6 +155,7 @@ BadGuy::kill_squished(Player& player)
 {
   SoundManager::get()->play_sound(IDToSound(SND_SQUISH), get_pos(),
       player.get_pos());
+  physic.enable_gravity(true);
   physic.set_velocity_x(0);
   physic.set_velocity_y(0);
   set_state(STATE_SQUISHED);