hack to make movingobject vs. static also call the collides function of the moving...
authorMatthias Braun <matze@braunis.de>
Sat, 26 May 2007 15:23:22 +0000 (15:23 +0000)
committerMatthias Braun <matze@braunis.de>
Sat, 26 May 2007 15:23:22 +0000 (15:23 +0000)
SVN-Revision: 5023

src/sector.cpp

index 29a0aa1..88b40cd 100644 (file)
@@ -889,9 +889,12 @@ void check_collisions(collision::Constraints* constraints,
   if(!collision::intersects(r1, r2))
     return;
 
+  MovingObject *moving_object = dynamic_cast<MovingObject*> (object);
   CollisionHit dummy;
   if(other != NULL && !other->collides(*object, dummy))
     return;
+  if(moving_object != NULL && !moving_object->collides(*other, dummy))
+    return;
 
   // calculate intersection
   float itop = r1.get_bottom() - r2.get_top();