MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / loadTitle

Function loadTitle

src/OpenLoco/src/Title.cpp:84–108  ·  view source on GitHub ↗

0x004442C4

Source from the content-addressed store, hash-verified

82
83 // 0x004442C4
84 static void loadTitle()
85 {
86 Scenario::sub_46115C();
87 if (Intro::state() == Intro::State::none)
88 {
89 uint16_t backupWord = getGameState().var_014A;
90 auto titlePath = Environment::getPath(Environment::PathId::title);
91 SceneManager::removeSceneFlags(SceneManager::Flags::networked);
92 S5::importSaveToGameState(titlePath, S5::LoadFlags::titleSequence);
93
94 CompanyManager::setControllingId(CompanyId(0));
95 CompanyManager::setSecondaryPlayerId(CompanyId::null);
96 if (!SceneManager::isNetworked())
97 {
98 CompanyManager::setSecondaryPlayerId(CompanyId(1));
99 if (!SceneManager::isNetworkHost())
100 {
101 CompanyManager::setControllingId(CompanyId(1));
102 CompanyManager::setSecondaryPlayerId(CompanyId(0));
103 }
104 }
105
106 getGameState().var_014A = backupWord;
107 }
108 }
109
110 static void reload()
111 {

Callers 1

reloadFunction · 0.85

Calls 10

sub_46115CFunction · 0.85
getPathFunction · 0.85
removeSceneFlagsFunction · 0.85
importSaveToGameStateFunction · 0.85
setControllingIdFunction · 0.85
CompanyIdEnum · 0.85
setSecondaryPlayerIdFunction · 0.85
isNetworkedFunction · 0.85
isNetworkHostFunction · 0.85
stateFunction · 0.70

Tested by

no test coverage detected