Light_PointInSolid: add check against model bounds

This commit is contained in:
Eric Wasylishen 2021-05-21 22:35:41 -06:00
parent ab6956c9d0
commit 4ba0e99d3f
1 changed files with 8 additions and 0 deletions

View File

@ -294,6 +294,14 @@ static bool Light_PointInSolid_r(const mbsp_t *bsp, const int nodenum, const vec
// Tests hull 0 of the given model
bool Light_PointInSolid(const mbsp_t *bsp, const dmodel_t *model, const vec3_t point)
{
// fast bounds check
for (int i = 0; i < 3; ++i) {
if (point[i] < model->mins[i])
return false;
if (point[i] > model->maxs[i])
return false;
}
return Light_PointInSolid_r(bsp, model->headnode[0], point);
}