From d140d767a497d20a8272a308a5d9e7b7199ee47e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 20 Dec 2018 18:20:25 +0100 Subject: [PATCH] - changed last commit to let the replacement take the original's place and add the old texture at the end with its name cleared. This is to ensure that this won't break ranged animations but aside from that should produce the same end result. --- src/textures/texturemanager.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/textures/texturemanager.cpp b/src/textures/texturemanager.cpp index 584664d3fe..1c535f4df9 100644 --- a/src/textures/texturemanager.cpp +++ b/src/textures/texturemanager.cpp @@ -468,10 +468,10 @@ void FTextureManager::ReplaceTexture (FTextureID picnum, FTexture *newtexture, b newtexture->Name = oldtexture->Name; newtexture->UseType = oldtexture->UseType; - // Add the new texture at the end of the texture list and clear the old one's name to ensure it won't be found anymore - // We cannot actually replace it because it may be referenced by some other texture. + Textures[index].Texture = newtexture; + newtexture->id = oldtexture->id; oldtexture->Name = ""; - AddTexture(newtexture); + AddTexture(oldtexture); } //==========================================================================