| 1198 | } |
| 1199 | |
| 1200 | static void GameSaveConfig(IniFile &ini, std::string_view grpname) |
| 1201 | { |
| 1202 | IniGroup &group = ini.GetOrCreateGroup(grpname); |
| 1203 | group.Clear(); |
| 1204 | |
| 1205 | GameConfig *config = GameConfig::GetConfig(AIConfig::SSS_FORCE_NEWGAME); |
| 1206 | std::string name; |
| 1207 | std::string value = config->SettingsToString(); |
| 1208 | |
| 1209 | if (config->HasScript()) { |
| 1210 | name = config->GetName(); |
| 1211 | } else { |
| 1212 | name = "none"; |
| 1213 | } |
| 1214 | |
| 1215 | group.CreateItem(name).SetValue(value); |
| 1216 | } |
| 1217 | |
| 1218 | /** |
| 1219 | * Save the version of OpenTTD to the ini file. |
no test coverage detected