From 63d2bcf91cdd6b1c14ff3af2728ec4f5db8d211e Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Mon, 19 Sep 2016 14:28:50 -0600 Subject: [PATCH] light: move empty values check to its own function --- light/entities.cc | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/light/entities.cc b/light/entities.cc index 0cecc360..a4e323a5 100644 --- a/light/entities.cc +++ b/light/entities.cc @@ -155,6 +155,20 @@ MatchTargets(void) } } +static void +CheckEmptyValues(const std::vector &edicts) +{ + // empty values warning + for (const auto &entdict : edicts) { + for (const auto &keyval : entdict) { + if (keyval.first.empty() || keyval.second.empty()) { + logprint("WARNING: empty key/value \"%s\" \"%s\"\n", + keyval.first.c_str(), keyval.second.c_str()); + } + } + } +} + /** * Checks `entdicts` for unmatched targets/targetnames and prints warnings */ @@ -900,17 +914,8 @@ LoadEntities(const globalconfig_t &cfg, const bsp2_t *bsp) entdicts = EntData_Parse(bsp->dentdata); - // empty values warning - for (const auto &entdict : entdicts) { - for (const auto &keyval : entdict) { - if (keyval.first.empty() || keyval.second.empty()) { - logprint("WARNING: empty key/value \"%s\" \"%s\"\n", - keyval.first.c_str(), keyval.second.c_str()); - } - } - } - CheckTargets(); + CheckEmptyValues(entdicts); // First pass: make permanent changes to the bsp entdata that we will write out // at the end of the light process.