(svn r15142) -Fix (r15126): missing NewGRFs cause a crash when getting the content list.
This commit is contained in:
@@ -600,7 +600,7 @@ struct NewGRFWindow : public Window {
|
|||||||
ContentInfo *ci = new ContentInfo();
|
ContentInfo *ci = new ContentInfo();
|
||||||
ci->type = CONTENT_TYPE_NEWGRF;
|
ci->type = CONTENT_TYPE_NEWGRF;
|
||||||
ci->state = ContentInfo::DOES_NOT_EXIST;
|
ci->state = ContentInfo::DOES_NOT_EXIST;
|
||||||
ttd_strlcpy(ci->name, c->name, lengthof(ci->name));
|
ttd_strlcpy(ci->name, c->name != NULL ? c->name : c->filename, lengthof(ci->name));
|
||||||
ci->unique_id = BSWAP32(c->grfid);
|
ci->unique_id = BSWAP32(c->grfid);
|
||||||
memcpy(ci->md5sum, c->md5sum, sizeof(ci->md5sum));
|
memcpy(ci->md5sum, c->md5sum, sizeof(ci->md5sum));
|
||||||
*cv.Append() = ci;
|
*cv.Append() = ci;
|
||||||
|
Reference in New Issue
Block a user