Don't report collisions if nothing got hit
authorWolfgang Becker <uafr@gmx.de>
Mon, 10 Jul 2006 00:28:12 +0000 (00:28 +0000)
committerWolfgang Becker <uafr@gmx.de>
Mon, 10 Jul 2006 00:28:12 +0000 (00:28 +0000)
SVN-Revision: 3974

src/sector.cpp

index 6a152e6..97bb349 100644 (file)
@@ -1010,7 +1010,7 @@ Sector::handle_collisions()
       if(constraints.hit.top || constraints.hit.bottom) {
         constraints.hit.left = false;
         constraints.hit.right = false;
-        moving_object->collision_solid(constraints.hit);
+          moving_object->collision_solid(constraints.hit);
       }
     }
 
@@ -1042,7 +1042,11 @@ Sector::handle_collisions()
     }
    
     if(constraints.has_constraints()) {
-      moving_object->collision_solid(constraints.hit);
+      if( constraints.hit.left || constraints.hit.right 
+          || constraints.hit.top || constraints.hit.bottom 
+         || constraints.hit.crush )
+        moving_object->collision_solid(constraints.hit);
+      //else printf("Wayne?\n");
     }    
     
     // an extra pass to make sure we're not crushed horizontally