From: Tobias Markus Date: Fri, 23 Aug 2013 14:18:38 +0000 (+0200) Subject: Checking if badguy is active before double-killing in a few more places X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=78e3808e86113b0917df92f44ac087a28b7865d1;p=supertux.git Checking if badguy is active before double-killing in a few more places --- diff --git a/src/badguy/badguy.cpp b/src/badguy/badguy.cpp index 8cbec1db3..0cca9f588 100644 --- a/src/badguy/badguy.cpp +++ b/src/badguy/badguy.cpp @@ -359,6 +359,8 @@ BadGuy::collision_bullet(Bullet& bullet, const CollisionHit& hit) void BadGuy::kill_squished(GameObject& object) { + if (!is_active()) return; + sound_manager->play("sounds/squish.wav", get_pos()); physic.enable_gravity(true); physic.set_velocity_x(0); @@ -377,6 +379,8 @@ BadGuy::kill_squished(GameObject& object) void BadGuy::kill_fall() { + if (!is_active()) return; + sound_manager->play("sounds/fall.wav", get_pos()); physic.set_velocity_y(0); physic.set_acceleration_y(0);