@@ -309,21 +309,19 @@ void ScanNewGRFFiles(void)
DEBUG(grf, 1, "Scanning for NewGRFs");
num = ScanPath(_paths.data_dir);
DEBUG(grf, 1, "Scan complete, found %d files", num);
}
/* Find a NewGRF in the scanned list */
const GRFConfig *FindGRFConfig(uint32 grfid, uint8 *md5sum)
/* Find a NewGRF in the scanned list, if md5sum is NULL, we don't care about it*/
const GRFConfig *FindGRFConfig(uint32 grfid, const uint8 *md5sum)
{
GRFConfig *c;
static const uint8 blanksum[sizeof(c->md5sum)] = { 0 };
for (const GRFConfig *c = _all_grfs; c != NULL; c = c->next) {
if (c->grfid == grfid) {
if (md5sum == NULL) return c;
for (c = _all_grfs; c != NULL; c = c->next) {
if (memcmp(blanksum, c->md5sum, sizeof(c->md5sum)) == 0) CalcGRFMD5Sum(c);
if (memcmp(md5sum, c->md5sum, sizeof(c->md5sum)) == 0) return c;
return NULL;