No crash, instead the game deletes old news when the hard limit of 65,535 news messages is reached.
When you generate more than 65,535 news messages while having the news message history window open, the game crashes with Assertion failed at line 673 of d:\a\1\s\src\widget_type.h: num <= MAX_UVALUE(uint16) = 65,535. Crash info has been generated.
Steps to reproduce
There are multiple ways to generate more than 65,535 news messages and crash the game.
Get yourself £(tens of billions) in the bank and/or use BaseCosts newGRF with "stuff with local authority" set to lowest value of /128.
Make sure that the setting "Allow funding road reconstruction" is On.
Open any town's Local Authority window.
Select the action named "Fund local road reconstruction" or "Buy exclusive transport rights".
Pause the game and then perform the town action at least 65,536 times at once.
When you open the news message history window, the game crashes.
Unzip and load up the savegame "gr0_50k_stations63.zip" (note that it will take 500-800 MB RAM to load due to all of the stations).
Open the news message history window.
Wait 10 ingame days. During that time, the game will generate dozens of station acceptance news messages per tick.
The game will crash on 10 Jan 2050 with the same error above.
The text was updated successfully, but these errors were encountered:
The assert triggers inside the SetCount() function, which is used whenever a window needs a scrollbar and the scrollbar needs to be updated (it "sets the number of elements in the list"). Therefore, any window that has a scrollbar (not just news message history window) could theoretically trigger the assert, including subsidies, goals, and story page elements.
With OpenTTD 1.9.2 stable, I can give myself £40 billion, buy exclusive transport rights, fund road reconstruction 64,000 (or 65,500) times, scroll the news message history window all the way down, fund road reconstruction another 4,000 (or 100) times, and the scrollbar will disappear. When I try to scroll again, it will appear that all of the 65,536 oldest news messages got deleted at once, leaving only the newest messages. Note that after 6 months, everything resolves itself due to OpenTTD only keeping the 32 recent news message. In those cases, OpenTTD did not crash.