mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-31 18:39:10 +00:00
Codechange: use std::optional<std::string> for changing the script over char *
This commit is contained in:
@@ -208,7 +208,7 @@
|
||||
if (_settings_game.ai_config[c] != nullptr && _settings_game.ai_config[c]->HasScript()) {
|
||||
if (!_settings_game.ai_config[c]->ResetInfo(true)) {
|
||||
Debug(script, 0, "After a reload, the AI by the name '{}' was no longer found, and removed from the list.", _settings_game.ai_config[c]->GetName());
|
||||
_settings_game.ai_config[c]->Change(nullptr);
|
||||
_settings_game.ai_config[c]->Change(std::nullopt);
|
||||
if (Company::IsValidAiID(c)) {
|
||||
/* The code belonging to an already running AI was deleted. We can only do
|
||||
* one thing here to keep everything sane and that is kill the AI. After
|
||||
@@ -225,7 +225,7 @@
|
||||
if (_settings_newgame.ai_config[c] != nullptr && _settings_newgame.ai_config[c]->HasScript()) {
|
||||
if (!_settings_newgame.ai_config[c]->ResetInfo(false)) {
|
||||
Debug(script, 0, "After a reload, the AI by the name '{}' was no longer found, and removed from the list.", _settings_newgame.ai_config[c]->GetName());
|
||||
_settings_newgame.ai_config[c]->Change(nullptr);
|
||||
_settings_newgame.ai_config[c]->Change(std::nullopt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user