mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r16590) -Fix [FS#2967]: don't crash when tars/newgrfs are removed, just tell the file could be opened/found.
This commit is contained in:
parent
b88443f035
commit
98b4f1fce2
|
@ -337,7 +337,7 @@ FILE *FioFOpenFileSp(const char *filename, const char *mode, Searchpath sp, Subd
|
|||
FILE *FioFOpenFileTar(TarFileListEntry *entry, size_t *filesize)
|
||||
{
|
||||
FILE *f = fopen(entry->tar_filename, "rb");
|
||||
assert(f != NULL);
|
||||
if (f == NULL) return f;
|
||||
|
||||
fseek(f, entry->position, SEEK_SET);
|
||||
if (filesize != NULL) *filesize = entry->size;
|
||||
|
|
|
@ -6212,8 +6212,11 @@ void LoadNewGRF(uint load_index, uint file_index)
|
|||
if (c->status == GCS_DISABLED || c->status == GCS_NOT_FOUND) continue;
|
||||
if (stage > GLS_INIT && HasBit(c->flags, GCF_INIT_ONLY)) continue;
|
||||
|
||||
/* @todo usererror() */
|
||||
if (!FioCheckFileExists(c->filename)) usererror("NewGRF file is missing '%s'", c->filename);
|
||||
if (!FioCheckFileExists(c->filename)) {
|
||||
DEBUG(grf, 0, "NewGRF file is missing '%s'; disabling", c->filename);
|
||||
c->status = GCS_NOT_FOUND;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (stage == GLS_LABELSCAN) InitNewGRFFile(c, _cur_spriteid);
|
||||
LoadNewGRFFile(c, slot++, stage);
|
||||
|
|
Loading…
Reference in New Issue