diff --git a/src/textures/multipatchtexture.cpp b/src/textures/multipatchtexture.cpp index e1e6faf3e..12cc02ea9 100644 --- a/src/textures/multipatchtexture.cpp +++ b/src/textures/multipatchtexture.cpp @@ -1324,7 +1324,7 @@ void FMultiPatchTexture::ResolvePatches() if (texno == id) // we found ourselves. Try looking for another one with the same name which is not a multipatch texture itself. { TArray list; - TexMan.ListTextures(Inits[i].TexName, list); + TexMan.ListTextures(Inits[i].TexName, list, true); for (int i = list.Size() - 1; i >= 0; i--) { if (list[i] != id && !TexMan[list[i]]->bMultiPatch) diff --git a/src/textures/texturemanager.cpp b/src/textures/texturemanager.cpp index 07ed71a3b..aa760c221 100644 --- a/src/textures/texturemanager.cpp +++ b/src/textures/texturemanager.cpp @@ -267,7 +267,7 @@ FTextureID FTextureManager::CheckForTexture (const char *name, int usetype, BITF // //========================================================================== -int FTextureManager::ListTextures (const char *name, TArray &list) +int FTextureManager::ListTextures (const char *name, TArray &list, bool listall) { int i; @@ -293,11 +293,14 @@ int FTextureManager::ListTextures (const char *name, TArray &list) // NULL textures must be ignored. if (tex->UseType!=FTexture::TEX_Null) { - unsigned int j; - for(j = 0; j < list.Size(); j++) + unsigned int j = list.Size(); + if (!listall) { - // Check for overriding definitions from newer WADs - if (Textures[list[j].GetIndex()].Texture->UseType == tex->UseType) break; + for (j = 0; j < list.Size(); j++) + { + // Check for overriding definitions from newer WADs + if (Textures[list[j].GetIndex()].Texture->UseType == tex->UseType) break; + } } if (j==list.Size()) list.Push(FTextureID(i)); } diff --git a/src/textures/textures.h b/src/textures/textures.h index 407500f18..064610f50 100644 --- a/src/textures/textures.h +++ b/src/textures/textures.h @@ -350,7 +350,7 @@ public: FTextureID CheckForTexture (const char *name, int usetype, BITFIELD flags=TEXMAN_TryAny); FTextureID GetTexture (const char *name, int usetype, BITFIELD flags=0); - int ListTextures (const char *name, TArray &list); + int ListTextures (const char *name, TArray &list, bool listall = false); void AddTexturesLump (const void *lumpdata, int lumpsize, int deflumpnum, int patcheslump, int firstdup=0, bool texture1=false); void AddTexturesLumps (int lump1, int lump2, int patcheslump);