added object remove_listener so that you can get a message if some objects are remove...
[supertux.git] / lib / special / collision.cpp
index b192dc3..46ed0bf 100644 (file)
@@ -38,7 +38,11 @@ Collision::rectangle_rectangle(CollisionHit& hit, const Rectangle& r1,
     hit.normal.y = 0;
   } else {
     if(movement.y > -DELTA && movement.y < DELTA) {
-      return false;
+      hit.time = 0;
+      hit.depth = 0;
+      hit.normal.x = 1;
+      hit.normal.y = 0;
+      return true;
     }
     hit.time = FLT_MAX;
   }
@@ -142,7 +146,6 @@ Collision::rectangle_aatriangle(CollisionHit& hit, const Rectangle& rect,
     return false;
   float time = depth / -(normal * movement);
   if(time < hit.time) {
-    printf("Time: %f.\n", time);
     hit.depth = depth;
     hit.time = time;
     hit.normal = normal;