| 978 | } |
| 979 | |
| 980 | static void GameLoadConfig(const IniFile &ini, std::string_view grpname) |
| 981 | { |
| 982 | const IniGroup *group = ini.GetGroup(grpname); |
| 983 | |
| 984 | /* Clean any configured GameScript */ |
| 985 | GameConfig::GetConfig(GameConfig::SSS_FORCE_NEWGAME)->Change(std::nullopt); |
| 986 | |
| 987 | /* If no group exists, return */ |
| 988 | if (group == nullptr || group->items.empty()) return; |
| 989 | |
| 990 | const IniItem &item = group->items.front(); |
| 991 | |
| 992 | GameConfig *config = GameConfig::GetConfig(AIConfig::SSS_FORCE_NEWGAME); |
| 993 | |
| 994 | config->Change(item.name); |
| 995 | if (!config->HasScript()) { |
| 996 | if (item.name != "none") { |
| 997 | Debug(script, 0, "The GameScript by the name '{}' was no longer found, and removed from the list.", item.name); |
| 998 | return; |
| 999 | } |
| 1000 | } |
| 1001 | if (item.value.has_value()) config->StringToSettings(*item.value); |
| 1002 | } |
| 1003 | |
| 1004 | /** |
| 1005 | * Load BaseGraphics set selection and configuration. |
no test coverage detected