Made SpriteParticle work around possible bug in Sprite::set_action. /
[supertux.git] / src / object / block.cpp
index 7f6e9f4..3ab0d1b 100644 (file)
@@ -54,6 +54,8 @@ Block::Block(Sprite* newsprite)
   bbox.set_size(32, 32.1);
   set_group(COLGROUP_STATIC);
   flags |= FLAG_SOLID;
+  sound_manager->preload("sounds/upgrade.wav");
+  sound_manager->preload("sounds/brick.wav");
 }
 
 Block::~Block()
@@ -204,7 +206,7 @@ BonusBlock::hit(Player& )
 void
 BonusBlock::try_open()
 {
-  if(sprite->get_action_name() == "empty") {
+  if(sprite->get_action() == "empty") {
     sound_manager->play("sounds/brick.wav");
     return;
   }
@@ -282,7 +284,7 @@ Brick::Brick(const Vector& pos, int data)
 void
 Brick::hit(Player& )
 {
-  if(sprite->get_action_name() == "empty")
+  if(sprite->get_action() == "empty")
     return;
   
   try_break(true);
@@ -291,7 +293,7 @@ Brick::hit(Player& )
 void
 Brick::try_break(bool playerhit)
 {
-  if(sprite->get_action_name() == "empty")
+  if(sprite->get_action() == "empty")
     return;
   
   sound_manager->play("sounds/brick.wav");