diff --git a/common/bsputils.cc b/common/bsputils.cc index 77afb42a..e9e50b45 100644 --- a/common/bsputils.cc +++ b/common/bsputils.cc @@ -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); }