projects
/
supertux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
46a3384
)
Checking if badguy is active before double-killing in a few more places
author
Tobias Markus
<tobbi@mozilla-uk.org>
Fri, 23 Aug 2013 14:18:38 +0000
(16:18 +0200)
committer
Tobias Markus
<tobbi@mozilla-uk.org>
Fri, 23 Aug 2013 14:18:38 +0000
(16:18 +0200)
src/badguy/badguy.cpp
patch
|
blob
|
history
diff --git
a/src/badguy/badguy.cpp
b/src/badguy/badguy.cpp
index
8cbec1d
..
0cca9f5
100644
(file)
--- 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);