(svn r24508) -Fix [FS#5281] (24488): Content GUI crashed after downloading a NewGRF while it is selected.

replace/41b28d7194a279bdc17475d4fbe2ea6ec885a466
frosch 12 years ago
parent 4512a4f225
commit e84cf93c98

@ -116,9 +116,11 @@ const char *ContentInfo::GetTextfile(TextfileType type) const
case CONTENT_TYPE_GAME_LIBRARY:
tmp = Game::GetScannerLibrary()->FindMainScript(this, true);
break;
case CONTENT_TYPE_NEWGRF:
tmp = FindGRFConfig(BSWAP32(this->unique_id), FGCM_EXACT, this->md5sum)->filename;
case CONTENT_TYPE_NEWGRF: {
const GRFConfig *gc = FindGRFConfig(BSWAP32(this->unique_id), FGCM_EXACT, this->md5sum);
tmp = gc != NULL ? gc->filename : NULL;
break;
}
case CONTENT_TYPE_BASE_GRAPHICS:
tmp = TryGetBaseSetFile(this, true, BaseGraphics::GetAvailableSets());
break;

Loading…
Cancel
Save