mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-16 08:52:40 +01:00
Codechange: use std::optional<std::string> over char * for text query results
This commit is contained in:
@@ -515,10 +515,10 @@ struct ScriptSettingsWindow : public Window {
|
||||
}
|
||||
}
|
||||
|
||||
void OnQueryTextFinished(char *str) override
|
||||
void OnQueryTextFinished(std::optional<std::string> str) override
|
||||
{
|
||||
if (StrEmpty(str)) return;
|
||||
int32_t value = atoi(str);
|
||||
if (!str.has_value() || str->empty()) return;
|
||||
int32_t value = atoi(str->c_str());
|
||||
|
||||
SetValue(value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user