Skip to content

Commit

Permalink
Fix remove_face (missing null leaves detect)
Browse files Browse the repository at this point in the history
Now cleanup empty leaves.
  • Loading branch information
UnrealKaraulov committed Jan 23, 2024
1 parent 702ed71 commit f270914
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/bsp/Bsp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6758,6 +6758,12 @@ bool Bsp::remove_face(int faceIdx)
{
for (int m = 0; m < leafCount; m++)
{
if (leaves[m].nMarkSurfaces <= 0 || leaves[m].iFirstMarkSurface < 0)
{
leaves[m].iFirstMarkSurface = 0;
leaves[m].nMarkSurfaces = 0;
continue;
}
if (leaves[m].nMarkSurfaces <= 0)
continue;
if (s >= leaves[m].iFirstMarkSurface && s < leaves[m].iFirstMarkSurface + leaves[m].nMarkSurfaces)
Expand Down

0 comments on commit f270914

Please sign in to comment.