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

Function GetFileByGRFID

src/newgrf.cpp:104–109  ·  view source on GitHub ↗

* Obtain a NewGRF file by its grfID * @param grfid The grfID to obtain the file for * @return The file. */

Source from the content-addressed store, hash-verified

102 * @return The file.
103 */
104GRFFile *GetFileByGRFID(uint32_t grfid)
105{
106 auto it = std::ranges::find(_grf_files, grfid, &GRFFile::grfid);
107 if (it != std::end(_grf_files)) return &*it;
108 return nullptr;
109}
110
111/**
112 * Obtain a NewGRF file by its filename

Callers 7

DisableGrfFunction · 0.85
GetCurrentGRFOverrideFunction · 0.85
GetNewEngineFunction · 0.85
GetLanguageMapMethod · 0.85
LoadNewGRFFunction · 0.85
ImportGRFSoundFunction · 0.85
ParamSetFunction · 0.85

Calls 2

findFunction · 0.50
endFunction · 0.50

Tested by

no test coverage detected