diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 2cd47564c..61b7103e2 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,6 @@ May 17, 2008 (Changes by Graf Zahl) +- Fixed: When FTextureManager::CheckForTexture finds a matching NULL texture + it should always return 0, not the actual texture's index. - Fixed coordinate checks for objects on 3DMidtex lines. - Fixed: All translucent blending operations for CopyColors must treat an alpha of 0 so that the pixel is not modified or texture composition as diff --git a/src/textures/texturemanager.cpp b/src/textures/texturemanager.cpp index 01dccf5e5..255e71dc6 100644 --- a/src/textures/texturemanager.cpp +++ b/src/textures/texturemanager.cpp @@ -125,6 +125,11 @@ int FTextureManager::CheckForTexture (const char *name, int usetype, BITFIELD fl { return i; } + else if (tex->UseType == FTexture::TEX_Null && usetype == FTexture::TEX_Wall) + { + // We found a NULL texture on a wall -> return 0 + return 0; + } else { if (firsttype == FTexture::TEX_Null || @@ -141,6 +146,8 @@ int FTextureManager::CheckForTexture (const char *name, int usetype, BITFIELD fl if ((flags & TEXMAN_TryAny) && usetype != FTexture::TEX_Any) { + // Never return the index of NULL textures. + if (firsttype == FTexture::TEX_Null) return 0; return firstfound; }