MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / GameSaveConfig

Function GameSaveConfig

src/settings.cpp:1200–1216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1198}
1199
1200static 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.

Callers 1

SaveToConfigFunction · 0.85

Calls 6

GetConfigFunction · 0.85
SettingsToStringMethod · 0.80
ClearMethod · 0.45
HasScriptMethod · 0.45
GetNameMethod · 0.45
SetValueMethod · 0.45

Tested by

no test coverage detected