Changed jump behaviour: Tux will now jump even if the button was pressed (up to)...
[supertux.git] / src / object / magicblock.cpp
index 9d0caf8..99135de 100644 (file)
@@ -42,7 +42,7 @@ namespace {
 }
 
 MagicBlock::MagicBlock(const lisp::Lisp& lisp)
-       : MovingSprite(lisp, "images/objects/magicblock/magicblock.sprite"),
+        : MovingSprite(lisp, "images/objects/magicblock/magicblock.sprite"),
         is_solid(false), solid_time(0), switch_delay(0), light(1.0f,1.0f,1.0f)
 {
   set_group(COLGROUP_STATIC);
@@ -144,14 +144,16 @@ MagicBlock::draw(DrawingContext& context){
   context.draw_filled_rect( get_bbox(), color, layer);
 }
 
+bool
+MagicBlock::collides(GameObject& /*other*/, const CollisionHit& /*hit*/)
+{
+  return is_solid;
+}
+
 HitResponse
 MagicBlock::collision(GameObject& /*other*/, const CollisionHit& /*hit*/)
 {
-  if(is_solid) {
-    return SOLID;
-  } else {
-    return PASSTHROUGH;
-  }
+  return SOLID;
 }
 
 IMPLEMENT_FACTORY(MagicBlock, "magicblock");