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

Method Change

src/script/script_config.cpp:22–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20#include "../safeguards.h"
21
22void ScriptConfig::Change(std::optional<std::string_view> name, int version, bool force_exact_match)
23{
24 if (name.has_value()) {
25 this->name = name.value();
26 this->info = this->FindInfo(this->name, version, force_exact_match);
27 } else {
28 this->info = nullptr;
29 }
30 this->version = (info == nullptr) ? -1 : info->GetVersion();
31 this->config_list.reset();
32 this->to_load_data.reset();
33
34 this->ClearConfigList();
35}
36
37ScriptConfig::ScriptConfig(const ScriptConfig &config)
38{

Callers 9

GameLoopMethod · 0.45
StartNewMethod · 0.45
ResetConfigMethod · 0.45
ChangeScriptMethod · 0.45
StartNewMethod · 0.45
GameLoopMethod · 0.45
ResetConfigMethod · 0.45
LoadMethod · 0.45
LoadMethod · 0.45

Calls 5

ClearConfigListMethod · 0.95
valueMethod · 0.45
FindInfoMethod · 0.45
GetVersionMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected