mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-26 22:11:43 +00:00
Re-fixed 95d74614
This should be dealt with at the source, not one level up, so that it also works properly if the GetReader function of the ResourceFile object is called directly and not through the resource manager.
This commit is contained in:
parent
3cf1959070
commit
c85389c976
2 changed files with 3 additions and 4 deletions
|
@ -106,7 +106,8 @@ public:
|
||||||
static FResourceFile *OpenResourceFile(const char *filename, bool quiet = false, bool containeronly = false);
|
static FResourceFile *OpenResourceFile(const char *filename, bool quiet = false, bool containeronly = false);
|
||||||
static FResourceFile *OpenDirectory(const char *filename, bool quiet = false);
|
static FResourceFile *OpenDirectory(const char *filename, bool quiet = false);
|
||||||
virtual ~FResourceFile();
|
virtual ~FResourceFile();
|
||||||
FileReader *GetReader() { return &Reader; }
|
// If this FResourceFile represents a directory, the Reader object is not usable so don't return it.
|
||||||
|
FileReader *GetReader() { return Reader.isOpen()? &Reader : nullptr; }
|
||||||
uint32_t LumpCount() const { return NumLumps; }
|
uint32_t LumpCount() const { return NumLumps; }
|
||||||
uint32_t GetFirstLump() const { return FirstLump; }
|
uint32_t GetFirstLump() const { return FirstLump; }
|
||||||
void SetFirstLump(uint32_t f) { FirstLump = f; }
|
void SetFirstLump(uint32_t f) { FirstLump = f; }
|
||||||
|
|
|
@ -1364,9 +1364,7 @@ FileReader *FWadCollection::GetFileReader(int wadnum)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return reader for real files only and nullptr otherwise
|
return Files[wadnum]->GetReader();
|
||||||
FileReader* const reader = Files[wadnum]->GetReader();
|
|
||||||
return reader->isOpen() ? reader : nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
Loading…
Reference in a new issue