Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

Commit

Permalink
Merge pull request #198 from storm-devs/fix/geometry-bsp-crash
Browse files Browse the repository at this point in the history
Fix crash caused by some broken models
  • Loading branch information
espkk authored Sep 5, 2021
2 parents 3ceeead + d6eb6d0 commit dd81e1b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/libs/geometry/src/collide.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,11 @@ rec_loop:;
{
const long face = (static_cast<long>(*(pface + 2)) << 16) | (static_cast<long>(*(pface + 1)) << 8) |
(static_cast<long>(*(pface + 0)) << 0);
// "fix" for broken models
if (face < 0 || face >= sizeof(trgclip) / sizeof(*trgclip))
{
continue;
}

// this triangle was added before
if (trgclip[face] != attempt)
Expand Down

0 comments on commit dd81e1b

Please sign in to comment.