From 25f4af734fa73006fa48c6463ce09c9b84aa1368 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 16 May 2014 10:56:23 +0200 Subject: [PATCH] - fixed: ACS's check...Texture functions must use the same search flags as the texture initialization code in p_setup.cpp and p_udmf.cpp. It also should not create textures that don't exist yet. We are only doing a comparison so it's not relevant if the texture exists or not. --- src/p_acs.cpp | 4 +++- src/textures/texturemanager.cpp | 1 + src/textures/textures.h | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index 9469da06e0..981870a360 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -3944,7 +3944,9 @@ bool DLevelScript::DoCheckActorTexture(int tid, AActor *activator, int string, b { return 0; } - FTexture *tex = TexMan.FindTexture(FBehavior::StaticLookupString(string)); + FTexture *tex = TexMan.FindTexture(FBehavior::StaticLookupString(string), FTexture::TEX_Flat, + FTextureManager::TEXMAN_Overridable|FTextureManager::TEXMAN_TryAny|FTextureManager::TEXMAN_DontCreate); + if (tex == NULL) { // If the texture we want to check against doesn't exist, then // they're obviously not the same. diff --git a/src/textures/texturemanager.cpp b/src/textures/texturemanager.cpp index aa9ef706b9..6fb963e42b 100644 --- a/src/textures/texturemanager.cpp +++ b/src/textures/texturemanager.cpp @@ -238,6 +238,7 @@ FTextureID FTextureManager::CheckForTexture (const char *name, int usetype, BITF FTexture *tex = Wads.GetLinkedTexture(lump); if (tex == NO_TEXTURE) return FTextureID(-1); if (tex != NULL) return tex->id; + if (flags & TEXMAN_DontCreate) return FTextureID(-1); // we only want to check, there's no need to create a texture if we don't have one yet. tex = FTexture::CreateTexture("", lump, FTexture::TEX_Override); if (tex != NULL) { diff --git a/src/textures/textures.h b/src/textures/textures.h index 8c41ee8442..15c9bce5c7 100644 --- a/src/textures/textures.h +++ b/src/textures/textures.h @@ -363,7 +363,8 @@ public: TEXMAN_Overridable = 2, TEXMAN_ReturnFirst = 4, TEXMAN_AllowSkins = 8, - TEXMAN_ShortNameOnly = 16 + TEXMAN_ShortNameOnly = 16, + TEXMAN_DontCreate = 32 }; FTextureID CheckForTexture (const char *name, int usetype, BITFIELD flags=TEXMAN_TryAny);