bspinfo: don't crash if light data is missing

This commit is contained in:
Eric Wasylishen 2022-12-21 20:58:08 -07:00
parent fe5ce3765a
commit 54ada5be6d
1 changed files with 4 additions and 0 deletions

View File

@ -400,6 +400,10 @@ static void export_obj_and_lightmaps(const mbsp_t &bsp, const bspxentries_t &bsp
continue; continue;
} }
if (bsp.dlightdata.empty()) {
continue;
}
auto in_pixel = auto in_pixel =
bsp.dlightdata.begin() + rect.lightofs + (rect.extents.numsamples() * (is_rgb ? 3 : 1) * style_index); bsp.dlightdata.begin() + rect.lightofs + (rect.extents.numsamples() * (is_rgb ? 3 : 1) * style_index);