From dca61f8bc231c9a136c927fc54343cfbcac6b04f Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Thu, 10 Oct 2019 09:14:35 -0600 Subject: [PATCH] light: fix "unexpected geomID" error with bounce --- light/trace_embree.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/light/trace_embree.cc b/light/trace_embree.cc index e488f7c8..5131dc99 100644 --- a/light/trace_embree.cc +++ b/light/trace_embree.cc @@ -758,8 +758,12 @@ qboolean Embree_TestSky(const vec3_t start, const vec3_t dirn, const modelinfo_t qboolean hit_sky = (ray.geomID == skygeom.geomID); if (face_out) { - const sceneinfo &si = Embree_SceneinfoForGeomID(ray.geomID); - *face_out = si.triToFace.at(ray.primID); + if (hit_sky) { + const sceneinfo &si = Embree_SceneinfoForGeomID(ray.geomID); + *face_out = si.triToFace.at(ray.primID); + } else { + *face_out = nullptr; + } } return hit_sky;