light: fix order of settings loading for last commit

This commit is contained in:
Eric Wasylishen 2019-10-31 00:51:56 -06:00
parent b132152891
commit 6b1bbf25ae
1 changed files with 10 additions and 8 deletions

View File

@ -1056,7 +1056,16 @@ LoadEntities(const globalconfig_t &cfg, const mbsp_t *bsp)
EntDict_CheckTargetKeysMatched(bsp, entdict, entdicts);
EntDict_CheckTargetnameKeyMatched(bsp, entdict, entdicts);
}
/* handle worldspawn */
for (const auto &epair : WorldEnt()) {
SetGlobalSetting(epair.first, epair.second, false);
}
/* apply side effects of settings (in particular "dirt") */
FixupGlobalSettings();
// NOTE: cfg is not valid until now.
// First pass: make permanent changes to the bsp entdata that we will write out
// at the end of the light process.
for (auto &entdict : entdicts) {
@ -1096,13 +1105,6 @@ LoadEntities(const globalconfig_t &cfg, const mbsp_t *bsp)
}
}
/* handle worldspawn */
for (const auto &epair : WorldEnt()) {
SetGlobalSetting(epair.first, epair.second, false);
}
/* apply side effects of settings (in particular "dirt") */
FixupGlobalSettings();
Q_assert(all_lights.empty());
if (nolights) {
return;