FS#3197 - NewGRF presets from openttd.cfg are not validated

Attached to Project: OpenTTD
Opened by frosch (frosch) - Saturday, 12 September 2009, 13:24 GMT
Last edited by frosch (frosch) - Saturday, 12 September 2009, 14:40 GMT
Type Bug
Category Core
Status Closed
Assigned To No-one
Operating System All
Severity Medium
Priority Normal
Reported Version 0.7.2
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


Applies to both 0.7.2 and trunk.

By editing openttd.cfg you can create presets which contain the same newgrf resp. newgrfs with same grfid multiple times.

When starting a new game with such presets the list is filtered and duplicate files and duplicate grfids are removed. However, when applying grfs ingame the list is not filtered and all grfs are activated.

When one instance of the grf causes the grfid to be deactivated (in the test scenario due to exceeding maximum number of grfs) OTTD crashes when loading subsequent newgrfs. Either by assert "src/newgrf.cpp:6222: void LoadNewGRF(uint, uint): Assertion 'GetFileByGRFID(c->grfid) == _cur_grffile' failed." or if disabled by usererror
"Error: File '<some subsequent newgrf' lost in cache."
This task depends upon

Closed by  frosch (frosch)
Saturday, 12 September 2009, 14:40 GMT
Reason for closing:  Fixed
Additional comments about closing:  in r17510