Light_PointInSolid: add check against model bounds
This commit is contained in:
parent
ab6956c9d0
commit
4ba0e99d3f
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue