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

Function AISaveConfig

src/settings.cpp:1180–1198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1178}
1179
1180static void AISaveConfig(IniFile &ini, std::string_view grpname)
1181{
1182 IniGroup &group = ini.GetOrCreateGroup(grpname);
1183 group.Clear();
1184
1185 for (CompanyID c = CompanyID::Begin(); c < MAX_COMPANIES; ++c) {
1186 AIConfig *config = AIConfig::GetConfig(c, AIConfig::SSS_FORCE_NEWGAME);
1187 std::string name;
1188 std::string value = config->SettingsToString();
1189
1190 if (config->HasScript()) {
1191 name = config->GetName();
1192 } else {
1193 name = "none";
1194 }
1195
1196 group.CreateItem(name).SetValue(value);
1197 }
1198}
1199
1200static void GameSaveConfig(IniFile &ini, std::string_view grpname)
1201{

Callers 1

SaveToConfigFunction · 0.85

Calls 7

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

Tested by

no test coverage detected