diff --git a/src/resourcefiles/resourcefile.cpp b/src/resourcefiles/resourcefile.cpp index 8a4f07fd7..24b3ad3d6 100644 --- a/src/resourcefiles/resourcefile.cpp +++ b/src/resourcefiles/resourcefile.cpp @@ -150,11 +150,22 @@ void FResourceLump::LumpNameSetup(const char *iname) // //========================================================================== +static bool IsWadInFolder(const char* const fullName) +{ + // Checks a special case when was put in + // directory inside + + const FString baseName = ExtractFileBase(fullName); + const FString fileName = baseName + '/' + baseName + ".wad"; + + return 0 == fileName.CompareNoCase(fullName); +} + void FResourceLump::CheckEmbedded() { // Checks for embedded archives const char *c = strstr(FullName, ".wad"); - if (c && strlen(c) == 4 && !strchr(FullName, '/')) + if (c && strlen(c) == 4 && (!strchr(FullName, '/') || IsWadInFolder(FullName))) { // Mark all embedded WADs Flags |= LUMPF_EMBEDDED;