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

Function GetTempDataEngine

src/saveload/engine_sl.cpp:46–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44static TypedIndexContainer<std::vector<Engine>, EngineID> _temp_engine;
45
46Engine *GetTempDataEngine(EngineID index)
47{
48 if (index < _temp_engine.size()) {
49 return &_temp_engine[index];
50 } else if (index == _temp_engine.size()) {
51 return &_temp_engine.emplace_back();
52 } else {
53 NOT_REACHED();
54 }
55}
56
57struct ENGNChunkHandler : ChunkHandler {
58 ENGNChunkHandler() : ChunkHandler('ENGN', CH_TABLE) {}

Callers 6

FixTTOEnginesFunction · 0.85
LoadOldEngineFunction · 0.85
LoadOldEngineNameFunction · 0.85
LoadMethod · 0.85
CopyTempEngineDataFunction · 0.85
LoadMethod · 0.85

Calls 2

NOT_REACHEDFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected