Skip to content

Conversation

@PeterN
Copy link
Member

@PeterN PeterN commented Dec 9, 2025

Data for action 4 is two lists. In d5a7b85, only the second list was updated.

Make both sets of data the correct length.

Before:

$ ./nforenum test.nfo
NFORenum 6.2.0-1-gf5837f8 - Copyright (C) 2025-12-09 by Dale McCoy
Processing file "test.nfo".
Failed to load data file: "4.dat". (/home/petern/src/grfcodec/src/strings.cpp:53)
nforenum: /home/petern/src/grfcodec/src/data.cpp:1291: int _CheckEOF(int, files, const char*, int): Assertion `false' failed.
Aborted

After:

$ ./nforenum test.nfo
NFORenum 6.2.0-2-gc7811d3 - Copyright (C) 2025-12-09 by Dale McCoy
Processing file "test.nfo".
Processing complete.

@rubidium42
Copy link
Contributor

Would something like static_assert(std::size(_dat4) == 2 + 1 + (_dat4[2] + 1) * 2 + 1); after the table be a good idea to prevent such issues in the future?

Data for action 4 is two lists, only the second list was updated.
@PeterN PeterN merged commit a92928e into OpenTTD:master Dec 9, 2025
6 checks passed
@PeterN PeterN deleted the fix-renum-act4 branch December 9, 2025 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants