diff --git a/include/common/settings.hh b/include/common/settings.hh index 5ef4c8c8..4795a8ce 100644 --- a/include/common/settings.hh +++ b/include/common/settings.hh @@ -601,12 +601,12 @@ public: bool parse(const std::string &settingName, parser_base_t &parser, bool locked = false) override { - if (auto value = parseString(parser)) { - addValueFromParse(*value, locked); - return true; - } + if (!parser.parse_token(PARSE_PEEK)) + return false; - return false; + parser.parse_token(); + addValueFromParse(parser.token, locked); + return true; } inline bool copyFrom(const setting_base& other) override { diff --git a/include/light/light.hh b/include/light/light.hh index 448af33d..a86df742 100644 --- a/include/light/light.hh +++ b/include/light/light.hh @@ -400,7 +400,7 @@ public: setting_bool highlightseams{this, "highlightseams", false, &debug_group, ""}; setting_soft soft{this, "soft", 0, -1, std::numeric_limits::max(), &postprocessing_group, "blurs the lightmap. specify n to blur radius in samples, otherwise auto"}; - setting_string radlights{this, "radlights", "", "\"filename.rad\"", &experimental_group, + setting_set radlights{this, "radlights", "\"filename.rad\"", &experimental_group, "loads a file"}; setting_int32 lmscale{ this, "lmscale", 0, &experimental_group, "change lightmap scale, vanilla engines only allow 16"}; diff --git a/light/light.cc b/light/light.cc index b7dd7435..e18c0124 100644 --- a/light/light.cc +++ b/light/light.cc @@ -120,8 +120,8 @@ void light_settings::postinitialize(int argc, const char **argv) } if (radlights.isChanged()) { - if (!ParseLightsFile(radlights.value())) { - logging::print("Unable to read surfacelights file {}\n", radlights.value()); + if (!ParseLightsFile(*radlights.values().begin())) { + logging::print("Unable to read surfacelights file {}\n", *radlights.values().begin()); } }