diff --git a/light/entities.cc b/light/entities.cc index 668bf963..8bacfe52 100644 --- a/light/entities.cc +++ b/light/entities.cc @@ -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;