X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fsector.cpp;h=f0463d80a2bcd4013f726efcd0ef87c151e7d675;hb=20a94a721fdee25587d1698ff8cfd6d014b590f1;hp=1df58d4a18da4f709e566b6dbc17ece813c7d5b7;hpb=fe138b9ec292ca9679b43cf5c4555f0193bab25d;p=supertux.git diff --git a/src/sector.cpp b/src/sector.cpp index 1df58d4a1..f0463d80a 100644 --- a/src/sector.cpp +++ b/src/sector.cpp @@ -787,7 +787,7 @@ Sector::collision_tilemap(const Rect& dest, const Vector& movement, // only handle unisolid when the player is falling down and when he was // above the tile before if(tile->getAttributes() & Tile::UNISOLID) { - if(movement.y < 0 || dest.get_top() - movement.y > y*32) + if(movement.y <= 0 || dest.get_top() - movement.y > y*32) continue; } @@ -818,31 +818,6 @@ Sector::collision_tilemap(const Rect& dest, const Vector& movement, uint32_t Sector::collision_tile_attributes(const Rect& dest) const { - /** XXX This function doesn't work correctly as it will check all tiles - * in the bounding box of the object movement, this might include tiles - * that have actually never been touched by the object - * (though this only occures for very fast objects...) - */ - -#if 0 - // calculate rectangle where the object will move - float x1, x2; - if(object->get_movement().x >= 0) { - x1 = object->get_bbox().p1.x; - x2 = object->get_bbox().p2.x + object->get_movement().x; - } else { - x1 = object->get_bbox().p1.x + object->get_movement().x; - x2 = object->get_bbox().p2.x; - } - float y1, y2; - if(object->get_movement().y >= 0) { - y1 = object->get_bbox().p1.y; - y2 = object->get_bbox().p2.y + object->get_movement().y; - } else { - y1 = object->get_bbox().p1.y + object->get_movement().y; - y2 = object->get_bbox().p2.y; - } -#endif float x1 = dest.p1.x; float y1 = dest.p1.y; float x2 = dest.p2.x;