Skip to content

Commit

Permalink
Fixed|Resources|libdoomsday: “.zip” is not always a data file
Browse files Browse the repository at this point in the history
Recognize “.pk3.zip” automatically as a data bundle, but “.zip”
would need to go through some content analysis before we know whether
it’s a resource pack.
  • Loading branch information
skyjake committed Feb 12, 2017
1 parent 99eaadd commit db48036
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions doomsday/apps/libdoomsday/src/resource/databundle.cpp
Expand Up @@ -1149,18 +1149,18 @@ File *DataBundle::Interpreter::interpretFile(File *sourceData) const
{
// Naive check using the file extension.
static struct { String str; Format format; } formats[] = {
{ ".zip", Pk3 },
{ ".pk3", Pk3 },
{ ".wad", Wad /* type (I or P) checked later */ },
{ ".lmp", Lump },
{ ".ded", Ded },
{ ".deh", Dehacked },
{ ".box", Collection },
{ ".pk3.zip", Pk3 },
{ ".pk3", Pk3 },
{ ".wad", Wad /* type (I or P) checked later */ },
{ ".lmp", Lump },
{ ".ded", Ded },
{ ".deh", Dehacked },
{ ".box", Collection },
};
String const ext = sourceData->extension();
//String const ext = sourceData->extension();
for (auto const &fmt : formats)
{
if (!fmt.str.compareWithoutCase(ext))
if (sourceData->name().endsWith(fmt.str, Qt::CaseInsensitive))
{
LOG_RES_XVERBOSE("Interpreted %s as %s",
sourceData->description() <<
Expand Down

0 comments on commit db48036

Please sign in to comment.