From 04601656ff0a0cf754d5b886649100f737489902 Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Thu, 15 Aug 2019 19:45:51 -0600 Subject: [PATCH] qbsp: Add support for _minlight_excludeN where N is in 2..9 --- qbsp/map.cc | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/qbsp/map.cc b/qbsp/map.cc index c383163e..39511d8e 100644 --- a/qbsp/map.cc +++ b/qbsp/map.cc @@ -313,11 +313,19 @@ FindTexinfoEnt(mtexinfo_t *texinfo, const mapentity_t *entity) if (atoi(ValueForKey(entity, "_minlight")) == -1) flags |= TEX_NOMINLIGHT; - const char *excludeTex = ValueForKey(entity, "_minlight_exclude"); - if (strlen(excludeTex) > 0 && !Q_strcasecmp(texname, excludeTex)) { - flags |= TEX_NOMINLIGHT; - } + // "_minlight_exclude", "_minlight_exclude2", "_minlight_exclude3"... + for (int i = 0; i <= 9; i++) { + std::string key = "_minlight_exclude"; + if (i > 0) { + key += std::to_string(i); + } + const char* excludeTex = ValueForKey(entity, key.c_str()); + if (strlen(excludeTex) > 0 && !Q_strcasecmp(texname, excludeTex)) { + flags |= TEX_NOMINLIGHT; + } + } + if (shadow == -1) flags |= TEX_NOSHADOW; if (!Q_strcasecmp("func_detail_illusionary", ValueForKey(entity, "classname"))) {