@@ -33,6 +33,9 @@ namespace toml_internal {
3333std::string EscapeString (const std::string_view str);
3434}
3535
36+ // Track config values that had type mismatches during loading
37+ extern std::vector<std::string>* config_type_mismatch_warnings;
38+
3639class ICommandVar {
3740 public:
3841 virtual ~ICommandVar () = default ;
@@ -147,7 +150,16 @@ inline void CommandVar<std::filesystem::path>::LoadFromLaunchOptions(
147150}
148151template <class T >
149152void ConfigVar<T>::LoadConfigValue(const toml::node* result) {
150- SetConfigValue (result->value <T>().value ());
153+ auto value_opt = result->value <T>();
154+ if (value_opt) {
155+ SetConfigValue (value_opt.value ());
156+ } else {
157+ // Type mismatch - track for warning
158+ if (!config_type_mismatch_warnings) {
159+ config_type_mismatch_warnings = new std::vector<std::string>();
160+ }
161+ config_type_mismatch_warnings->push_back (this ->name_ );
162+ }
151163}
152164template <>
153165inline void ConfigVar<std::filesystem::path>::LoadConfigValue(
@@ -157,7 +169,16 @@ inline void ConfigVar<std::filesystem::path>::LoadConfigValue(
157169}
158170template <class T >
159171void ConfigVar<T>::LoadGameConfigValue(const toml::node* result) {
160- SetGameConfigValue (result->value <T>().value ());
172+ auto value_opt = result->value <T>();
173+ if (value_opt) {
174+ SetGameConfigValue (value_opt.value ());
175+ } else {
176+ // Type mismatch - track for warning
177+ if (!config_type_mismatch_warnings) {
178+ config_type_mismatch_warnings = new std::vector<std::string>();
179+ }
180+ config_type_mismatch_warnings->push_back (this ->name_ );
181+ }
161182}
162183template <>
163184inline void ConfigVar<std::filesystem::path>::LoadGameConfigValue(
0 commit comments