1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-25 21:24:12 +01:00

Fix: do not use lengthof() for non C-style arrays

This commit is contained in:
Rubidium
2024-04-05 22:34:20 +02:00
committed by Loïc Guilloux
parent 774ea5676f
commit 6a9517a4e6
3 changed files with 3 additions and 3 deletions

View File

@@ -1028,7 +1028,7 @@ static void GraphicsSetLoadConfig(IniFile &ini)
if (const IniItem *item = group->GetItem("extra_params"); item != nullptr && item->value) {
auto &extra_params = BaseGraphics::ini_data.extra_params;
extra_params.resize(lengthof(GRFConfig::param));
extra_params.resize(0x80); // TODO: make ParseIntList work nicely with C++ containers
int count = ParseIntList(item->value->c_str(), &extra_params.front(), extra_params.size());
if (count < 0) {
SetDParamStr(0, BaseGraphics::ini_data.name);