Skip to content

Commit

Permalink
Stop looping sounds for all offscreen badguys
Browse files Browse the repository at this point in the history
  • Loading branch information
tobbi committed Aug 14, 2023
1 parent eee7c16 commit a03ed1c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
2 changes: 2 additions & 0 deletions src/badguy/badguy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -666,13 +666,15 @@ BadGuy::set_state(State state_)
break;
case STATE_ACTIVE:
set_group(m_colgroup_active);
play_looping_sounds();
//bbox.set_pos(start_position);
break;
case STATE_INACTIVE:
// Was the badguy dead anyway?
if (laststate == STATE_SQUISHED || laststate == STATE_FALLING) {
remove_me();
}
stop_looping_sounds();
set_group(COLGROUP_DISABLED);
break;
case STATE_FALLING:
Expand Down
8 changes: 0 additions & 8 deletions src/badguy/haywire.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,14 +226,6 @@ Haywire::active_update(float dt_sec)
}
}

void
Haywire::deactivate()
{
// Stop ticking/grunting sounds, in case we are deactivated before actually
// exploding (see https://github.com/SuperTux/supertux/issues/1260).
stop_looping_sounds();
}

void
Haywire::draw(DrawingContext& context)
{
Expand Down
1 change: 0 additions & 1 deletion src/badguy/haywire.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class Haywire final : public WalkingBadguy
virtual void ignite() override;

virtual void active_update(float dt_sec) override;
virtual void deactivate() override;
virtual void draw(DrawingContext& context) override;

virtual bool is_freezable() const override;
Expand Down

0 comments on commit a03ed1c

Please sign in to comment.