From d78b31a94131912008528949e4cb1542e0a4a23c Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Fri, 21 Jun 2019 20:36:13 +1000 Subject: [PATCH] Don't apply downloaded texture pack if the URL changes, fixes #426 This can happen if texture pack takes a long time to download and the user changes maps. --- src/TexturePack.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/TexturePack.c b/src/TexturePack.c index 2811c9d67..bfb7043b5 100644 --- a/src/TexturePack.c +++ b/src/TexturePack.c @@ -734,8 +734,10 @@ void TexturePack_Extract_Req(struct HttpRequest* item) { bool png; ReturnCode res; - url = String_FromRawArray(item->URL); - String_Copy(&World_TextureUrl, &url); + url = String_FromRawArray(item->URL); + /* Took too long to download and is no longer active texture pack */ + if (!String_Equals(&World_TextureUrl, &url)) return; + data = item->Data; len = item->Size; Stream_ReadonlyMemory(&mem, data, len);