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

Function GetCurrentGRFOverride

src/newgrf.cpp:196–204  ·  view source on GitHub ↗

* Get overridden GRF for current GRF if present. * @return Overridden GRFFile if present, or nullptr. */

Source from the content-addressed store, hash-verified

194 * @return Overridden GRFFile if present, or nullptr.
195 */
196GRFFile *GetCurrentGRFOverride()
197{
198 auto found = _grf_id_overrides.find(_cur_gps.grffile->grfid);
199 if (found != std::end(_grf_id_overrides)) {
200 GRFFile *grffile = GetFileByGRFID(found->second);
201 if (grffile != nullptr) return grffile;
202 }
203 return nullptr;
204}
205
206/**
207 * Returns the engine associated to a certain internal_id, resp. allocates it.

Callers 1

LoadTranslationTableFunction · 0.85

Calls 3

GetFileByGRFIDFunction · 0.85
endFunction · 0.50
findMethod · 0.45

Tested by

no test coverage detected