diff options
author | rubidium <rubidium@openttd.org> | 2007-04-04 12:03:10 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-04-04 12:03:10 +0000 |
commit | 1c1a4bc872b1bbc18a9ebe468f30d8dade922f74 (patch) | |
tree | c43d134ecdffb49cfa20069d19250e6a2d89b769 /src/newgrf.cpp | |
parent | 45b0c8042fa51c9cedfd6cda51187711382ae6d6 (diff) | |
download | openttd-1c1a4bc872b1bbc18a9ebe468f30d8dade922f74.tar.xz |
(svn r9560) -Codechange: add support for multiple 'base' directories for newgrf searching.
-Codechange: do not add duplicate files to the newgrf list.
Diffstat (limited to 'src/newgrf.cpp')
-rw-r--r-- | src/newgrf.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp index d83634188..a2dd255cb 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -4305,7 +4305,7 @@ static void InitNewGRFFile(const GRFConfig *config, int sprite_offset) if (newfile == NULL) error ("Out of memory"); - newfile->filename = strdup(config->filename); + newfile->filename = strdup(config->full_path); newfile->sprite_offset = sprite_offset; /* Copy the initial parameter list */ @@ -4583,7 +4583,7 @@ static void DecodeSpecialSprite(uint num, GrfLoadingStage stage) void LoadNewGRFFile(GRFConfig *config, uint file_index, GrfLoadingStage stage) { - const char *filename = config->filename; + const char *filename = config->full_path; uint16 num; /* A .grf file is activated only if it was active when the game was @@ -4699,7 +4699,7 @@ void LoadNewGRF(uint load_index, uint file_index) if (c->status == GCS_DISABLED || c->status == GCS_NOT_FOUND) continue; /* @todo usererror() */ - if (!FioCheckFileExists(c->filename)) error("NewGRF file is missing '%s'", c->filename); + if (!FileExists(c->full_path)) error("NewGRF file is missing '%s'", c->filename); if (stage == GLS_LABELSCAN) InitNewGRFFile(c, _cur_spriteid); LoadNewGRFFile(c, slot++, stage); |