From d6ef557a1c147c9e6a42daeeab4fa122a670e9dd Mon Sep 17 00:00:00 2001 From: sigonasr2 Date: Wed, 13 Sep 2023 16:28:51 -0500 Subject: [PATCH] Comment on why we need overlapping collision rectangles. --- Crawler/Crawler.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Crawler/Crawler.cpp b/Crawler/Crawler.cpp index 07c3bef3..3dffcc70 100644 --- a/Crawler/Crawler.cpp +++ b/Crawler/Crawler.cpp @@ -1112,6 +1112,7 @@ geom2d::rectCrawler::GetTileCollision(MapName map,vf2d pos,bool upperLevel) if(foundRect.pos==NO_COLLISION.pos&&foundRect.size==NO_COLLISION.size){ foundRect=collisionRect; }else{ + //When we find another rectangle in the same square, we expand it to consume the area, whichever tile creates a larger surface or the combination of the two. foundRect.pos.x=std::min(foundRect.pos.x,collisionRect.pos.x); foundRect.pos.y=std::min(foundRect.pos.y,collisionRect.pos.y); foundRect.size.x=std::max(foundRect.size.x,collisionRect.size.x);