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

Function LoadOldCustomString

src/saveload/oldloader_sl.cpp:1399–1410  ·  view source on GitHub ↗

* Read a single string from the savegame. * @param ls The state for loading this save game. * @param index The index of the loaded custom string. * @return Always true. */

Source from the content-addressed store, hash-verified

1397 * @return Always true.
1398 */
1399bool LoadOldCustomString(LoadgameState &ls, int index)
1400{
1401 /*
1402 * Data is stored in fixed size "cells"; read these completely.
1403 * Validation and conversion to UTF-8 are happening at a later stage.
1404 */
1405 std::string &str = _old_name_array[index];
1406 str.resize(_savegame_type == SGT_TTO ? 24 : 32);
1407 for (auto &c : str) c = ReadByte(ls);
1408
1409 return true;
1410}
1411
1412static const OldChunks sign_chunk[] = {
1413 OCL_VAR ( OC_UINT16, 1, &_old_string_id ),

Callers

nothing calls this directly

Calls 2

ReadByteFunction · 0.85
resizeMethod · 0.80

Tested by

no test coverage detected