Skip to content

Commit

Permalink
fix: slightly more accurate house size estimation (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
luan authored Oct 7, 2023
1 parent c0b839e commit 6eaec63
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ vcproj/Project/x64/
vcproj/Installer/Beta Release/
vcproj/Installer/Debug/
vcproj/Installer/Release/
vcpkg_installed/
.vscode/
*.filters
*.users
Expand Down
5 changes: 3 additions & 2 deletions source/house.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,9 @@ size_t House::size() const
{
size_t count = 0;
for(PositionList::const_iterator pos_iter = tiles.begin(); pos_iter != tiles.end(); ++pos_iter) {
Tile* tile = map->getTile(*pos_iter);
if(tile && !tile->isBlocking())
auto tile = map->getTile(*pos_iter);
auto topItem = tile->getTopItem();
if(tile && (!tile->getWall() || tile->getTable() || topItem->isDoor()))
++count;
}
return count;
Expand Down

0 comments on commit 6eaec63

Please sign in to comment.