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

Function reset

src/OpenLoco/src/World/CompanyManager.cpp:65–95  ·  view source on GitHub ↗

0x0042F7F8

Source from the content-addressed store, hash-verified

63
64 // 0x0042F7F8
65 void reset()
66 {
67 // First, empty all non-empty companies.
68 for (auto& company : companies())
69 {
70 company.name = StringIds::empty;
71 }
72
73 getGameState().produceAICompanyTimeout = 0;
74
75 // Reset player companies depending on network mode.
76 if (SceneManager::isNetworkHost())
77 {
78 rawPlayerCompanies()[0] = CompanyId(1);
79 rawPlayerCompanies()[1] = CompanyId(0);
80 }
81 else if (SceneManager::isNetworked())
82 {
83 rawPlayerCompanies()[0] = CompanyId(0);
84 rawPlayerCompanies()[1] = CompanyId(1);
85 }
86 else
87 {
88 rawPlayerCompanies()[0] = CompanyId(0);
89 rawPlayerCompanies()[1] = CompanyId::null;
90 }
91
92 // Reset primary company colours.
93 rawCompanies()[0].mainColours.primary = Colour::mutedSeaGreen;
94 updateColours();
95 }
96
97 // 0x00525FB7
98 uint8_t getMaxCompetingCompanies()

Callers

nothing calls this directly

Calls 5

companiesFunction · 0.85
isNetworkHostFunction · 0.85
CompanyIdEnum · 0.85
isNetworkedFunction · 0.85
updateColoursFunction · 0.85

Tested by

no test coverage detected