# HG changeset patch # User Rubidium # Date 2024-01-18 21:08:22 # Node ID c5c88f8151550df399f14dfa845d7138513c5cba # Parent 5ccf0fef109d90e48ceb849fe7862d6106e96de3 Codechange: use TO_LE16 directly when reading language file offsets diff --git a/src/strings.cpp b/src/strings.cpp --- a/src/strings.cpp +++ b/src/strings.cpp @@ -1840,17 +1840,11 @@ bool ReadLanguagePack(const LanguageMeta return false; } -#if TTD_ENDIAN == TTD_BIG_ENDIAN - for (uint i = 0; i < TEXT_TAB_END; i++) { - lang_pack->offsets[i] = ReadLE16Aligned(&lang_pack->offsets[i]); - } -#endif /* TTD_ENDIAN == TTD_BIG_ENDIAN */ - std::array tab_start, tab_num; uint count = 0; for (uint i = 0; i < TEXT_TAB_END; i++) { - uint16_t num = lang_pack->offsets[i]; + uint16_t num = FROM_LE16(lang_pack->offsets[i]); if (num > TAB_SIZE) return false; tab_start[i] = count;