Codechange: use std::optional<std::string> for changing the script over char *

This commit is contained in:
Rubidium
2023-05-05 21:59:50 +02:00
committed by rubidium42
parent 0fd9eb0faa
commit 9f2fc860ad
9 changed files with 25 additions and 21 deletions

View File

@@ -175,7 +175,7 @@
if (_settings_game.game_config != nullptr && _settings_game.game_config->HasScript()) {
if (!_settings_game.game_config->ResetInfo(true)) {
Debug(script, 0, "After a reload, the GameScript by the name '{}' was no longer found, and removed from the list.", _settings_game.game_config->GetName());
_settings_game.game_config->Change(nullptr);
_settings_game.game_config->Change(std::nullopt);
if (Game::instance != nullptr) {
delete Game::instance;
Game::instance = nullptr;
@@ -188,7 +188,7 @@
if (_settings_newgame.game_config != nullptr && _settings_newgame.game_config->HasScript()) {
if (!_settings_newgame.game_config->ResetInfo(false)) {
Debug(script, 0, "After a reload, the GameScript by the name '{}' was no longer found, and removed from the list.", _settings_newgame.game_config->GetName());
_settings_newgame.game_config->Change(nullptr);
_settings_newgame.game_config->Change(std::nullopt);
}
}
}