changeset 10839 | a62547c31fdb |
parent 10837 | 90f01f8fd55d |
child 10886 | 5fff9f00e677 |
10838:1dd920e2c20d | 10839:a62547c31fdb |
---|---|
5781 * During activation, only actions 0, 1, 2, 3, 4, 5, 7, 8, 9, 0A and 0B are |
5781 * During activation, only actions 0, 1, 2, 3, 4, 5, 7, 8, 9, 0A and 0B are |
5782 * carried out. All others are ignored, because they only need to be |
5782 * carried out. All others are ignored, because they only need to be |
5783 * processed once at initialization. */ |
5783 * processed once at initialization. */ |
5784 if (stage != GLS_FILESCAN && stage != GLS_SAFETYSCAN && stage != GLS_LABELSCAN) { |
5784 if (stage != GLS_FILESCAN && stage != GLS_SAFETYSCAN && stage != GLS_LABELSCAN) { |
5785 _cur_grffile = GetFileByFilename(filename); |
5785 _cur_grffile = GetFileByFilename(filename); |
5786 if (_cur_grffile == NULL) error("File '%s' lost in cache.\n", filename); |
5786 if (_cur_grffile == NULL) usererror("File '%s' lost in cache.\n", filename); |
5787 if (stage == GLS_RESERVE && config->status != GCS_INITIALISED) return; |
5787 if (stage == GLS_RESERVE && config->status != GCS_INITIALISED) return; |
5788 if (stage == GLS_ACTIVATION && !HasBit(config->flags, GCF_RESERVED)) return; |
5788 if (stage == GLS_ACTIVATION && !HasBit(config->flags, GCF_RESERVED)) return; |
5789 _cur_grffile->is_ottdfile = config->IsOpenTTDBaseGRF(); |
5789 _cur_grffile->is_ottdfile = config->IsOpenTTDBaseGRF(); |
5790 } |
5790 } |
5791 |
5791 |
5987 for (GRFConfig *c = _grfconfig; c != NULL; c = c->next) { |
5987 for (GRFConfig *c = _grfconfig; c != NULL; c = c->next) { |
5988 if (c->status == GCS_DISABLED || c->status == GCS_NOT_FOUND) continue; |
5988 if (c->status == GCS_DISABLED || c->status == GCS_NOT_FOUND) continue; |
5989 if (stage > GLS_INIT && HasBit(c->flags, GCF_INIT_ONLY)) continue; |
5989 if (stage > GLS_INIT && HasBit(c->flags, GCF_INIT_ONLY)) continue; |
5990 |
5990 |
5991 /* @todo usererror() */ |
5991 /* @todo usererror() */ |
5992 if (!FioCheckFileExists(c->filename)) error("NewGRF file is missing '%s'", c->filename); |
5992 if (!FioCheckFileExists(c->filename)) usererror("NewGRF file is missing '%s'", c->filename); |
5993 |
5993 |
5994 if (stage == GLS_LABELSCAN) InitNewGRFFile(c, _cur_spriteid); |
5994 if (stage == GLS_LABELSCAN) InitNewGRFFile(c, _cur_spriteid); |
5995 LoadNewGRFFile(c, slot++, stage); |
5995 LoadNewGRFFile(c, slot++, stage); |
5996 if (stage == GLS_RESERVE) { |
5996 if (stage == GLS_RESERVE) { |
5997 SetBit(c->flags, GCF_RESERVED); |
5997 SetBit(c->flags, GCF_RESERVED); |