Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
madame-rachelle committed Oct 26, 2016
2 parents b460ce3 + fa8e05d commit e533bc8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/d_iwad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ void FIWadManager::ParseIWadInfos(const char *fn)
int FIWadManager::ScanIWAD (const char *iwad)
{
FResourceFile *iwadfile = FResourceFile::OpenResourceFile(iwad, NULL, true);
if (iwadfile == NULL) iwadfile = FResourceFile::OpenDirectory(iwad, true); //mxd. A directory can also work as an IWAD

if (iwadfile != NULL)
{
Expand Down Expand Up @@ -344,7 +345,7 @@ int FIWadManager::CheckIWAD (const char *doomwaddir, WadStuff *wads)

iwad.Format ("%s%s%s", doomwaddir, slash, mIWadNames[i].GetChars());
FixPathSeperator (iwad);
if (FileExists (iwad))
if (DirEntryExists(iwad))
{
wads[i].Type = ScanIWAD (iwad);
if (wads[i].Type != -1)
Expand Down Expand Up @@ -413,7 +414,7 @@ int FIWadManager::IdentifyVersion (TArray<FString> &wadfiles, const char *iwad,
}
else
{
DefaultExtension (custwad, ".wad");
if(FileExists(custwad)) DefaultExtension (custwad, ".wad"); //mxd. Don't treat folders as .wads
iwadparm = custwad;
mIWadNames[0] = custwad;
CheckIWAD ("", &wads[0]);
Expand Down
18 changes: 18 additions & 0 deletions src/textures/multipatchtexture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1325,6 +1325,24 @@ void FMultiPatchTexture::ResolvePatches()
for (int i = 0; i < NumParts; i++)
{
FTextureID texno = TexMan.CheckForTexture(Inits[i].TexName, Inits[i].UseType);
if (texno == id) // we found ourselves. Try looking for another one with the same name which is not a multipatch texture itself.
{
TArray<FTextureID> list;
TexMan.ListTextures(Inits[i].TexName, list);
for (int i = list.Size() - 1; i >= 0; i--)
{
if (list[i] != id && !TexMan[list[i]]->bMultiPatch)
{
texno = list[i];
break;
}
}
if (texno == id)
{
if (Inits[i].HasLine) Inits[i].sc.Message(MSG_WARNING, "Texture '%s' references itself as patch\n", Inits[i].TexName.GetChars());
else Printf(TEXTCOLOR_YELLOW "Texture '%s' references itself as patch\n", Inits[i].TexName.GetChars());
}
}

if (!texno.isValid())
{
Expand Down

0 comments on commit e533bc8

Please sign in to comment.