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

Function saveNewScore

src/OpenLoco/src/Scenario/ScenarioManager.cpp:407–423  ·  view source on GitHub ↗

0x00438959

Source from the content-addressed store, hash-verified

405
406 // 0x00438959
407 void saveNewScore(Scenario::ObjectiveProgress& progress, const CompanyId companyId)
408 {
409 auto res = findScenario(getGameState().scenarioFileName);
410 if (!res.has_value())
411 {
412 return;
413 }
414 auto& entry = _scenarioList[res.value()];
415 if (!entry.hasFlag(ScenarioIndexFlags::completed) || progress.completedChallengeInMonths < entry.completedMonths)
416 {
417 entry.flags |= ScenarioIndexFlags::completed;
418 entry.completedMonths = progress.completedChallengeInMonths;
419 auto* company = CompanyManager::get(companyId);
420 StringManager::formatString(entry.highscoreName, company->name);
421 saveIndex();
422 }
423 }
424
425 // 0x00525F5E
426 uint32_t getScenarioTicks()

Callers 1

Calls 6

findScenarioFunction · 0.85
formatStringFunction · 0.85
valueMethod · 0.80
saveIndexFunction · 0.70
getFunction · 0.50
hasFlagMethod · 0.45

Tested by

no test coverage detected