From 34358bd66972e94745ccd8e8eecc67cff739f883 Mon Sep 17 00:00:00 2001 From: Christoph Sommer Date: Mon, 17 Jul 2006 00:36:19 +0000 Subject: [PATCH] Sector::is_free_space knows about slope tiles SVN-Revision: 4034 --- src/sector.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/sector.cpp b/src/sector.cpp index 247a3dec3..1afc7873b 100644 --- a/src/sector.cpp +++ b/src/sector.cpp @@ -1170,6 +1170,15 @@ Sector::is_free_space(const Rect& rect) const const Tile* tile = solids->get_tile(x, y); if(!tile) continue; + if(tile->getAttributes() & Tile::SLOPE) { + AATriangle triangle; + Vector p1(x*32, y*32); + Vector p2((x+1)*32, (y+1)*32); + triangle = AATriangle(p1, p2, tile->getData()); + Constraints constraints; + return collision::rectangle_aatriangle(&constraints, rect, triangle); + } + // FIXME: also test unisolid tiles if(tile->getAttributes() & Tile::SOLID) return false; } -- 2.11.0