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

Method Load

src/saveload/engine_sl.cpp:133–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131 ENGSChunkHandler() : ChunkHandler('ENGS', CH_READONLY) {}
132
133 void Load() const override
134 {
135 /* Load old separate String ID list into a temporary array. This
136 * was always 256 entries. */
137 TypedIndexContainer<std::array<StringID, 256>, EngineID> names{};
138
139 SlCopy(names.data(), std::size(names), SLE_STRINGID);
140
141 /* Copy each string into the temporary engine array. */
142 for (EngineID engine = EngineID::Begin(); engine < std::size(names); ++engine) {
143 Engine *e = GetTempDataEngine(engine);
144 e->name = CopyFromOldName(names[engine]);
145 }
146 }
147};
148
149/** Save and load the mapping between the engine id in the pool, and the grf file it came from. */

Callers

nothing calls this directly

Calls 6

SlCopyFunction · 0.85
BeginFunction · 0.85
GetTempDataEngineFunction · 0.85
CopyFromOldNameFunction · 0.85
sizeFunction · 0.50
dataMethod · 0.45

Tested by

no test coverage detected