From 69bc2c04c0d44ccf4159e95d120df45c5c63d0e9 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Fri, 8 Sep 2023 10:43:48 -0400 Subject: [PATCH] fix crash if projected texture is not found --- light/entities.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/light/entities.cc b/light/entities.cc index c8a4160c..67549939 100644 --- a/light/entities.cc +++ b/light/entities.cc @@ -1004,9 +1004,11 @@ void LoadEntities(const settings::worldspawn_keys &cfg, const mbsp_t *bsp) if (!entity->project_texture.value().empty()) { auto texname = entity->project_texture.value(); entity->projectedmip = img::find(texname); - if (entity->projectedmip == nullptr) { + if (entity->projectedmip == nullptr || + entity->projectedmip->pixels.empty()) { logging::print( "WARNING: light has \"_project_texture\" \"{}\", but this texture was not found\n", texname); + entity->projectedmip = nullptr; } if (!entity->projangle.is_changed()) { // mxd